Christer
Christer

Reputation: 3076

Cordova iOS <a href="mailto:" and <a href="tel:" only working on long press

I have two simple links in my app:

<a href="tel:00000000">Call 00000000</a>

<a href="mailto:[email protected]?subject=xxx"><i class="icon-envelope"></i><span data-string="email">Email</span></a>

And none of them works when clicked, only when long pressed. They work fine when clicked on Android, Safari browser and when building and running the app in XCode to a device. However it does NOT work after uploading the app to "Test Flight". I find this very strange...

In my config file I have added access origins:

    <access origin="*" />
    <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" />

My version of Cordova is 6.1.0

And as mentioned it's only in test flight it's not responding on click event, I haven't published to prod(app store) because I have to be 100% sure this functionality works. Any one else having this problem ?

The current version in app store works just fine, this version was published a month ago.

Can it be that Apple has set restriction for this functionality, because someone misused the "tel:" to auto dial 911, and haven't informed developers about it ?

Upvotes: 2

Views: 2900

Answers (1)

Christer
Christer

Reputation: 3076

It took me some time to figure out this "problem, but this works for me:

<a href="#" onclick="window.open('tel:00000000', '_system'); return false;">Call 00000000</a>

I also tried with window.location = "tel:00000000" but this didn't work.

So for now I guess I'll have to use window.open('tel:xxxxxxxx', '_system')

Btw, if you want no redirection from current page set href to ->

href="javascript:void(0);"

Upvotes: 6

Related Questions