Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open the phone dialer?

I am trying to launch the phone dialer in my worklight 6.2 hybrid application when clicking on a button and/or an anchor tag. Below is the code I am using.

button:

<button onClick='window.parent.location.href = "tel:+1xxxx"'>Tel</button>

anchor tag:

<a href='tel:+18001111111' class="ui-link">(800) 111-1111</a>  

When we click on button/anchor tag below is the behavior in android and iOS.
In android:

Displays a pop up window with the message

Application Error net::ERR_UNKNOWN_URL_SCHEME (TEL:+18001111111)

In iOS:

The click event doesn't respond.

like image 577
user3878988 Avatar asked Aug 04 '14 15:08

user3878988


People also ask

How do I get to my phone dialer?

In your App Drawer (application list) by default, you should find the Voice Dialer included with nearly all Android versions. Tap Voice Dialer to open it. Note you can always add this “app” to your home screen for easy and quick access.

How do I get my dialer back?

If in case you have a rooted and by mistake or intently you have uninstalled the phone Dialer, the best way to get it back and that's without restoring is to download the Phone Dialer apk file for your phone from a trusted source or by extracting it from the Custom Rom that you can find by searching “Custom Rom for ...


2 Answers

Are you testing in the iOS Simulator? if so, you must test in a device.
For Android, you can test in either the Emulator or a device.

The following worked for me in an iOS device:

  • <a href="tel:+1-800-555-1234">call this number</a>
    Can be invoked right from the HTML

  • document.location.href = "tel:+375292771265";
    Can be invoked via a function on button tap

As for Android,

Due to security bugs in Cordova (and the fixes made to counter them), to get the above code to work, you need to open native\res\xml\config.xml and perform the following:

 - <access origin="*"/>
 + <access origin="tel:*" launch-external="true"/>
like image 163
Idan Adar Avatar answered Oct 18 '22 13:10

Idan Adar


this cordova plugin are use

mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"

Code

   <ion-fab left bottom>
    <a href="tel:number" class="button" ion-fab color="light">
        <ion-icon name="keypad"></ion-icon>
    </a>
</ion-fab>
like image 39
rangholiya nikunj Avatar answered Oct 18 '22 14:10

rangholiya nikunj