我有一个非常小的应用程序:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<a href="mailto:someone@example.com">Send Mail</a>
<a href="tel: +18543458975">Call</a>
<button onclick="document.location.href = 'tel:+1-800-555-1234'">Click me</button>
<button onclick="document.location.href = 'tel:+18543458975'">Click again</button>
</body>
</html>
当我构建并运行它时,链接根本不起作用。
两周前(在另一个应用程序上)它运行良好,但现在它在我的旧应用程序上不起作用。
我没有想法了!
发生了什么?
最佳答案
使用 http/https 以外的协议(protocol)现在被列入白名单,默认情况下被阻止。
http://cordova.apache.org/announcements/2014/08/04/android-351.html http://cordova.apache.org/announcements/2014/09/08/cordova-361.html
您只需将 mailto 和 tel 协议(protocol)添加到白名单即可。
请参阅 http://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html 的“外部应用程序白名单”部分有关从 3.6.0 开始将什么添加到白名单的说明。
由于围绕此的安全漏洞已在 3.5.1 中得到修复,因此您不希望使用 3.5.0,否则您将容易受到攻击并从 Google Play 商店收到警告。
关于android - 手机调用或mailto根本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26546566/