Mobile phone or mailto does not work at all

I have a really small application:

<!DOCTYPE html> <html> <head> <title></title> </head> <body> <a href="mailto: someone@example.com ">Send Mail</a> <a href="tel: +18543458975">Call</a> <button onclick="document.location.href = 'tel:+1-800-555-1234'">Click me</button> <button onclick="document.location.href = 'tel:+18543458975'">Click again</button> </body> </html> 

When I create and run it, the links do not work at all.

Two weeks ago (in another application) this worked fine, but now it does not work in my old applications.

I'm out of ideas!

What's happening?

+5
source share
3 answers

The use of protocols other than http / https is now included in the white list and is blocked by default.

http://cordova.apache.org/announcements/2014/08/04/android-351.html http://cordova.apache.org/announcements/2014/09/08/cordova-361.html

You just need to add mailto and tel protocols to the white list.

See the External App Whitelist section of http://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html for instructions on what to add to the whitelist starting with version 3.6.0.

Since the security vulnerability associated with this was fixed in 3.5.1, you do not want to use 3.5.0, otherwise you will be vulnerable and will receive a warning from the Google Play store.

+15
source

I think that everything has changed with the new version.

You must install the list of Cordova plugins :

 cordova plugin add cordova-plugin-whitelist 

or if you want to keep a link to your config.xml file:

 cordova plugin add cordova-plugin-whitelist --save 

and that you should add the intent to your config.xml file :

 <allow-intent href="mailto:*" /> <allow-intent href="tel:*" /> 

You can find more information here .

+14
source

It seemed to me that the error was from the version of cordova 3.6 that I was working on, so I installed an older version (3.5), and now it works great!

0
source

Source: https://habr.com/ru/post/1205431/


All Articles