[SOLVED] How to use href="tel:11111" to dial

when I use this HTML code

<a href="tel:1111">call me</a>

It does not work,How can I dial a telephone number。

<a class="external" href="tel:1111">call me</a>
3 Likes

I have the allow-intents in my config.xml and tried the above a href.
But it does not work.

Can it be, because i am using the phonegap emulator via the phonegap CLI ?
Must the app be build for the phone call or mailto links work?

Greetings and thanks in advance!

yes it can be an issue as emulator can’t make any calls

1 Like

I just found it out and think that it should be mentioned somewhere in the documentation for all the phonegap users.
You need to add a target="_system" to the a href link.
So a link could look like this:

<a class="link external icon-only button button-fill-md button-large-md color-green" href="tel:1111" target="_system">
  <i class="icon material-icons">phone</i>
</a>

Thanks for your support nolmits4web !

For this to work on iOS on the home screen you have to use both the external class and use a click event otherwise Safari blocks the mailto

<a href="#" onclick="window.location='mailto:[email protected]'; return false;" class="external">email</a>

<a href="mailto:..." class="external">..</a>

The following works on both android and iOS and can be called from within javascript or in the elements onclick="…" handler.

window.open("tel:5551212");
<a onclick="window.open('tel:5551212')" class="external">Call Now!</a>

(Now to confirm the call with an action-sheet :wink: )

1 Like

@shastox yes yes I just didnt put the full clip

@PPetree have you tested from the home screen on iOS with your solution? I know my option works on both Safari and on the iOS home screen (which is non standard Safari)

@powers Yep. It absolutely works.

Hi,
I have a situation where there is no calling app installed in laptop, then i need to open a popup to copy the number to my clipboard. In this case how can i know that there is no calling app installed to open the popup.