Search code examples
ioscordovaionic-frameworksip

How to choose dialer app in iOS Ionic app?


I am currently working on an ionic app for iOS and I am facing a problem. I want to make a call via a SIP client. The thing is iOS doesn't let me choose which app to use for the call, it just uses the native dialer. My question is: is there any way to make iOS ask me which app to choose? The code I currently use is:

window.open('tel:' + nr);

I also tried:

window.open('tel:' + nr, '_system');

Solution

  • You can use Call Number native plugin.

    Installation :

    ionic cordova plugin add call-number
    npm install @ionic-native/call-number
    

    Usage :

    import { CallNumber } from '@ionic-native/call-number/ngx';
    
    constructor(private callNumber: CallNumber) { }
    
    ...
    
    
    this.callNumber.callNumber("18001010101", false) // Set to false to allow user to choose app
      .then(res => console.log('Launched dialer!', res))
      .catch(err => console.log('Error launching dialer', err));
    

    callNumber() takes two parameters :

    • number: String; phone number to call (e.g. "1234567890")

    • bypassAppChooser: boolean; true if you always wish to bypass the app chooser if user has multiple applications installed that can handle calls