2016-08-27 14:02:07 +08:00
|
|
|
import { Plugin, Cordova } from './plugin';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name CallNumber
|
|
|
|
* @description
|
|
|
|
* Call a number directly from your Cordova/Ionic application.
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```
|
|
|
|
* import {CallNumber} from 'ionic-native';
|
|
|
|
*
|
|
|
|
* CallNumber.callNumber(18001010101, true)
|
|
|
|
* .then(() => console.log('Launched dialer!'))
|
|
|
|
* .catch(() => console.log('Error launching dialer'));
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
@Plugin({
|
2016-10-28 01:48:50 +08:00
|
|
|
pluginName: 'CallNumber',
|
2016-08-27 14:02:07 +08:00
|
|
|
plugin: 'call-number',
|
|
|
|
pluginRef: 'plugins.CallNumber',
|
|
|
|
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',
|
|
|
|
platforms: ['iOS', 'Android']
|
|
|
|
})
|
|
|
|
export class CallNumber {
|
|
|
|
/**
|
|
|
|
* Calls a phone number
|
2016-09-20 06:20:51 +08:00
|
|
|
* @param numberToCall {string} The phone number to call as a string
|
2016-08-27 14:02:07 +08:00
|
|
|
* @param bypassAppChooser {boolean} Set to true to bypass the app chooser and go directly to dialer
|
2016-11-30 06:40:50 +08:00
|
|
|
* @return {Promise<any>}
|
2016-08-27 14:02:07 +08:00
|
|
|
*/
|
|
|
|
@Cordova({
|
|
|
|
callbackOrder: 'reverse'
|
|
|
|
})
|
2016-09-20 06:20:51 +08:00
|
|
|
static callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any> {
|
2016-08-27 14:02:07 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|