gpt4 book ai didi

javascript - 如何检测用户是否接受或拒绝 iOS 上的调用提示?

转载 作者:行者123 更新时间:2023-11-28 04:16:36 25 4
gpt4 key购买 nike

在 iOS 上,当我做 <a href="tel:1234">call me</a> , 会弹出提示。

我如何在 javascript 中检测用户是取消还是接受调用电话?

onBlur and onFocus不会在 iOS 上触发。

谢谢。

最佳答案

简答不,这在网页上是不可能的。如果您通过使用自定义提示创建 native 应用程序,这可能是可能的。

长答案

此提示是对 911 漏洞的响应。 https://9to5mac.com/2017/03/06/911-ios-exploit/

在10.3 Release notes中可以看到 https://developer.apple.com/library/content/releasenotes/General/RN-iOSSDK-10.3/

此行为在 https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html 中有进一步解释。

The tel URL scheme is used to launch the Phone app on iOS devices and initiate dialing of the specified phone number. When a user taps a telephone link in a webpage, iOS displays an alert asking if the user really wants to dial the phone number and initiates dialing if the user accepts. When a user opens a URL with the tel scheme in a native app, iOS 10.3 and later displays an alert and requires user confirmation before dialing. (When this scenario occurs in versions of iOS prior to 10.3, iOS initiates dialing without further prompting the user and does not display an alert, although a native app can be configured to display its own alert.)

根据 RFC 3966 : 11. 安全考虑

Web clients and similar tools MUST NOT use the "tel" URI to place telephone calls without the explicit consent of the user of that client. Placing calls automatically without appropriate user confirmation may incur a number of risks, such as those described below:

o Calls may incur costs.

o The URI may be used to place malicious or annoying calls.

o A call will take the user's phone line off-hook, thus preventing its use.

o A call may reveal the user's possibly unlisted phone number to the remote host in the caller identification data and may allow the attacker to correlate the user's phone number with other information, such as an e-mail or IP address.

另见 Suppressing the native dialog when clicking on a tel: link

关于javascript - 如何检测用户是否接受或拒绝 iOS 上的调用提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46619467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com