How do I just get my href=“tel:” on the latest version of Safari to immediately recognize it's a phone call and show the “Call” button?

半城伤御伤魂 提交于 2021-01-29 05:28:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!