22

I'm new to mobile hybrid app development. I have a HTML 5 hybrid app developed in Angular and Ionic where in part of the application i want to launch the native phone app (or a menu of various ways to get to the native phone app) when a user clicks on a phone number. When i view the hybrid app through a browser in my phone, clicking on the links works as expected. However, if i deploy the application to my Samsung Galaxy S5 (via cordova), tapping the links does nothing. I've tried the following syntaxes:

<a href="tel:18888888">tel:18888888</a>
<a href="tel:+18888888">tel:+18888888</a>
<a href="tel://18888888">tel://18888888</a>
<a href="tel://+18888888">tel://+18888888</a>
<a href="tel:1-888-8888">tel:1-888-8888</a>
<a href="tel://1-888-8888">tel:1-888-8888</a>

I'm using Cordova 3.6.0 and the Android SDK r23.0.2 windows.

I've googled similar issues but the results are inconsistent.

Has anyone had any luck with this? Seems like a common feature. I must be missing something simple.

Robert Taylor
  • 221
  • 1
  • 2
  • 4
  • 17
    SOLVED! Cordova 3.6.0 introduces a second whitelist, for restricting which URLs are allowed to launch external applications. Cordova 3.6.0 Whitelist Guide So you need to add explicitly in the config.xml: This answer was from a post here: http://stackoverflow.com/questions/15745096/android-phonegap-how-to-open-native-google-maps-application – Robert Taylor Oct 17 '14 at 20:54
  • I missed the solution first then came back to the same page with different search keywords on google ;p .. you get a thumbs up !! – Kiran Ruth R Dec 08 '14 at 11:41
  • You can answer your question @RobertTaylor by the way i have posted now :) – Pratik Butani Jan 17 '15 at 05:18

2 Answers2

21

You should add this line in config.xml to let the app lunch an external app: <access origin="tel:*" launch-external="yes" />

Amine OUAFI
  • 318
  • 2
  • 9
15

As Commented above:

Cordova 3.6.0 introduces a second whitelist, for restricting which URLs are allowed to launch external applications. Cordova 3.6.0 Whitelist Guide So you need to add explicitly in the config.xml:

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

Originally posted here.

Thanks

Community
  • 1
  • 1
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437