电话:*和短信:*链接在phonegap中的cordova下的ios上不起作用? [英] Tel:* and Sms:* links don't work on ios under cordova in phonegap?
问题描述
我的应用使用href:tel链接,并且在一年前首次发布时可以正常使用.
My app uses href: tel links and it worked correctly, when I first released it a year ago.
我在config.xml中使用了allow-intent:
I used allow-intent in my config.xml:
<access origin="*"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<plugin name="cordova-plugin-whitelist"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
但是现在具有相同配置的iOS刚编译的应用程序不适用于href:tel链接.没事.
But now freshly compiled app for iOS with the same config doesnt work with href: tel links. Just nothing happens.
如此处所述:cordova-为什么tel:*链接不起作用在iOS上? -堆栈溢出 我需要从config.xml中删除allow-navigation.但是我在那里没有.
As said here: cordova - Why tel:* links don't work on ios? - Stack Overflow I need to remove allow-navigation from config.xml. But I dont have it there.
什么才能使其在新的cordova下正常工作?
What is the proper configuration to make it work under new cordova?
其他外部链接和短信:*也不起作用,但是在iPad上,电话:*链接提供了复制号码(预期的行为)
other external links and sms:* dont work as well, but on iPad tel:* link offers to copy number (expected behaivior)
推荐答案
尝试删除电话和短信的访问来源
Try removing the access origin for tel and sms
<access origin="tel:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
您还可以尝试将CLI版本设置为6.4.0,intent和导航过滤器在cordova-ios 4.3.0中的工作方式有所变化,并且您使用的是4.2.0
Also you can try setting the CLI version to 6.4.0, there has been some changes in how the intent and navigation filter worked in cordova-ios 4.3.0 and you are using 4.2.0
<preference name="phonegap-version" value="cli-6.4.0" />
但是我看到一个错误报告,该错误报告说明在使用Cordova在本地编译该应用程序但无法在Phonegap Build上运行该应用程序时,该链接可能有效.
But I've seen a bug report about tel links working when the app was locally compiled with Cordova but not working on Phonegap Build, so it might be a bug there.
这篇关于电话:*和短信:*链接在phonegap中的cordova下的ios上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!