Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tel: href "Click to call" link not working in Android

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

like image 309
Vijay Avatar asked Nov 27 '14 06:11

Vijay


People also ask

How do I link a phone number to a Hyperlink?

Make sure to enter it without dashes and enter “tel:” before you start typing your number. For example: <a href= “tel:+YOURNUMBERHERE” Next, you'll add any text you wish to link.


1 Answers

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

like image 192
manukv Avatar answered Sep 23 '22 10:09

manukv