Call Number
Call a number directly from your Cordova/Ionic application. NOTE: The iOS Simulator (and maybe Android Simulators) do not provide access to the phone subsystem.
Repo: https://github.com/Rohfosho/CordovaCallNumberPlugin
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add call-number $ npm install --save @ionic-native/call-number@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { CallNumber } from '@ionic-native/call-number';
constructor(private callNumber: CallNumber) { }
...
this.callNumber.callNumber("18001010101", true)
.then(res => console.log('Launched dialer!', res))
.catch(err => console.log('Error launching dialer', err));
Instance Members
callNumber(numberToCall, bypassAppChooser)
Calls a phone number
Param | Type | Details |
---|---|---|
numberToCall |
string
|
The phone number to call as a string |
bypassAppChooser |
boolean
|
Set to true to bypass the app chooser and go directly to dialer |
Returns: Promise<any>
isCallSupported()
Check if call feature is available
Returns: Promise<any>