cordova(ex phonegap)tel:<a href=""> not working in ios5</a>中的链接

时间:2012-06-09 14:40:04

标签: ios5 hyperlink cordova jqmobi

我已经在stackoverflow,google,phonegap和其他网站上查到了所有地方,但我找不到解决方案,但如果我确实错过了正确的链接,请发给我,因为我迷路了。

1:我正在使用Cordova + JQmobi编写我的应用程序。 2:唯一不起作用的链接是TEL:在标签链接中。 3:他们在Safari for ios中工作(我从ios4到ios5.1找到的任何版本) 4:仅在ios5中,TEL:的链接将无法在原生应用中使用

这里是我尝试的代码:

<a href="tel:+39000000">Link to the tel</a>
<a href="tel:+39000000" target="_blank">Link to the tel</a>
<a href="tel:+39000000" target="_self">Link to the tel</a>
<a href="" onclick="windows.location('tel:+39000000')" target="_blank">Link to the tel</a>

我使用的电话号码格式如下: 电话:+39000000(+39是意大利) 电话:123456(我尝试过任何类型的真实电话号码,但我没有#,*或空格) 电话:// + 39123456

当我在xCode模拟器上查看SMS:链接时,我收到此错误: AppDelegate :: shouldStartLoadWithRequest:收到未处理的URL短信:+39123456

这是正确的,因为模拟器没有SMS应用程序,但是当我尝试TEL:链接时: 无法加载有错误的网页:无法显示网址

如果你写一个你想用浏览器打开的非法律网址,就会发生这种情况。

我已经读过jqmobi(和jqtouch等其他框架一样)可能会阻止链接的默认行为,但是如果你明确地调用它的话。

ios5的真正改变是什么?因为我的所有链接都适用于ios4.3

那里的任何人请帮助我和我看到的许多其他人找不到这个Apple新版本的真正解决方案。

全部谢谢

2 个答案:

答案 0 :(得分:2)

我的解决方案是:没有解决方案。但是一个插件: https://github.com/mchristie/PhoneGap-ios-PhoneDialer/

如果您使用cordova,请务必检查您需要更改的4行(cordova而不是phonegap)

答案 1 :(得分:0)

您是否尝试删除“+”?

<a href="tel:39000000">Link to the tel</a>
<a href="tel:39000000" target="_blank">Link to the tel</a>
<a href="tel:39000000" target="_self">Link to the tel</a>
<a href="" onclick="windows.location('tel:39000000')" target="_blank">Link to the tel</a>

从他们的规格来看,听起来他们并不完全支持所有特殊字符:
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html