Lucas Freitas Lucas Freitas - 4 months ago 59
Android Question

Ionic call intent doesn't work

Greatings!

I'm trying to send a direct intent like this

<a href="tel:1699999999">Click me!</a> //brazilian number


but when I click on the link, nothing happens!

I already installed the "whitelist-plugin" and added

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


to my config.xml. I'm using the latest versions of IONIC and CORDOVA by npm.

Any ideas ?

Answer

I've accomplished this without having to use the allow-intent tag. In my case, it was a matter of formatting the telephone number before putting it in the href.

config.xml

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

HTML

<a href="tel:555-555-5555">Call Location</a>

If your phone number is coming through dynamically, you can format it within your controller and render out the scope variable

HTML

<a href="tel:{{formattedPhone}}">Call Location</a>