JavaScript – Tel: href “click to call” link cannot run in Android

In my Cordova android app, I have such a link

< a href = "Tel: 011123456789" > Click call < / a >

This click to call link is working as expected in IOS, but in Android, click is blocked in a similar way

This is the log cat result when I click the phone number link, and redirection doesn't work

In addition, I tried JavaScript Click to override redirection, but it didn't work. Please help me find a solution

I'm using Cordova 3.6

resolvent:

This problem may be due to Cordova whitelist licensing. You can specify access rights in the config.xml file

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

There are some security updates in Cordova 3.6.3 update

Security repair involves creating a new whitelist for non http / s protocols. If your application uses protocols other than http: / / and HTTPS: / /, such as SMS:, mailto:, geo:, etc., you 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 the following to config.xml

Just read more about Cordova Android security update

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>