最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - tel: href "Click to call" link not working in Android - Stack Overflow

programmeradmin2浏览0评论

In my Cordova android app I have a link like this

<a href = "tel:011123456789">Click to Call</a>

This click to call link is working in IOS as expected, but in Android the click is preventing by something like

11-26 11:13:00.565: D/WebCore(18944): uiOverrideUrlLoading: shouldOverrideUrlLoading() returnstrue

this is my log cat result when clicked on the phone number link and the redirection is not working.

Also i tried javascript click to override the redirection, but that also not worked. Please help me to find a solution.

I am using Cordova 3.6

In my Cordova android app I have a link like this

<a href = "tel:011123456789">Click to Call</a>

This click to call link is working in IOS as expected, but in Android the click is preventing by something like

11-26 11:13:00.565: D/WebCore(18944): uiOverrideUrlLoading: shouldOverrideUrlLoading() returnstrue

this is my log cat result when clicked on the phone number link and the redirection is not working.

Also i tried javascript click to override the redirection, but that also not worked. Please help me to find a solution.

I am using Cordova 3.6

Share Improve this question asked Nov 27, 2014 at 6:54 VijayVijay 1131 silver badge5 bronze badges 3
  • Did you tried window.location.href of that number? – manukv Commented Nov 27, 2014 at 7:01
  • Hi manukv.. I have tried .. var href = $(this).attr("href"); var number = href.split(":")[1]; window.location.href = number; but nothing happened – Vijay Commented Nov 27, 2014 at 7:04
  • Did you gve white listing access in your config.xml? – manukv Commented Nov 27, 2014 at 7:06
Add a comment  | 

1 Answer 1

Reset to default 22

This issues is may due to the cordova whitelist permission issue. You can specify the access in your Config.xml file like

 <access origin="tel:*" launch-external="yes" />

In Cordova 3.6.3 update there are some security update.

The security fixes involves creating a new whitelist for non http/s protocols. If your application uses other protocols besides http:// and https://, such as sms:, mailto:, geo:, etc., then you will need to make some configuration changes to add these protocols to the whitelist.

<access origin="tel:*" launch-external="yes"/>
<access origin="geo:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<access origin="market:*" launch-external="yes"/>

add these following to your Config.xml

Just read more Cordova-Android Security Update

发布评论

评论列表(0)

  1. 暂无评论