问题
We have a call button on our web application. It's a simple button that uses the standard href="tel:" function. Here is a snippet of what my call link looks like.
<a href="tel:1-234-867-5309" class="btn btn-success font-weight-light callus-btn py-2" title="Call us today!"><span class="text-uppercase">Call Us</span> <br>{{$contactSetting->format_phone}}</a>
The latest version of Safari appears to have changed the behavior to a long gesture, which requires a click of more than a second, then offers a number of features like "Facetime" as you can see in the image below.
How do I just get my href="tel:" on safari to immediately recognize it's a phone call and immediately show the "Call" button? By immediately I mean remove the 1 second lag that appears to be the safari default for this link type.
IOS Version: 14.0.1 Safari Version: 14.0.1
回答1:
After further testing and research, I realized my issue was that because my widget was now rendered via an iframe, safari doesn't handle the call link the same manner that it does one within the HTML. To get it to handle a call link within an iframe, you have to add target="_parent" to the anchor so that it looks like this:
<a href="tel:1-234-867-5309" target="_parent" class="btn btn-success font-weight-light callus-btn py-2" title="Call us today!"><span class="text-uppercase">Call Us</span> <br>{{$contactSetting->format_phone}}</a>
I learned this after testing a call link within the parent page, then reading who should receive credit for this question: Phone links are not working inside iframe though it does work in div in iOS9 web. how to make phone links make work in iOS9 safari?
来源:https://stackoverflow.com/questions/65061855/how-do-i-just-get-my-href-tel-on-the-latest-version-of-safari-to-immediately