Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Ionic 2 Dial A Number

Access to tel:* is already present in the config.xml file for Ionic 2. If not you can allow access in the config.xml file by adding the following :

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

in your ts file :

import ...

declare let window;

export class MoathdevPage {

call(mobile){
    //You can add some logic here
    mobile = encodeURIComponent(mobile);
     window.location = "tel:"+mobile;
    }
    
}    

As you can see we are using the encodeURIComponent() function. This will automatically convert the # to %23. Note that if try to cover the whole string tel:+123#456-789 this will not work, so we are concatenating "tel:" with passed number.

About

Ionic 2 Dial A Number In Ionic 2 Apps

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors