我如何才能获得我的 href=“tel:"?在最新版本的 Safari 上立即识别这是一个电话并显示“呼叫"按钮? [英] 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?

查看:49
本文介绍了我如何才能获得我的 href=“tel:"?在最新版本的 Safari 上立即识别这是一个电话并显示“呼叫"按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的网络应用程序上有一个呼叫按钮.这是一个使用标准href="tel:" 功能的简单按钮.这是我的通话链接的片段.

解决方案

经过进一步的测试和研究,我意识到我的问题是因为我的小部件现在是通过 iframe 呈现的,safari 不会以相同的方式处理调用链接它在 HTML 中执行一个.要让它处理 iframe 中的调用链接,您必须添加 target="_parent";到锚点,使其看起来像这样:

我在测试父页面内的呼叫链接后了解到这一点,然后阅读谁应该获得此问题的信用:电话链接在 iframe 中不起作用,尽管它在 iOS9 web 中的 div 中有效.如何让手机链接在 iOS9 Safari 中生效?

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

解决方案

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?

这篇关于我如何才能获得我的 href=“tel:"?在最新版本的 Safari 上立即识别这是一个电话并显示“呼叫"按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆