-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(call-number): add support for CallNumber plugin (#487)
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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({ | ||
plugin: 'call-number', | ||
pluginRef: 'plugins.CallNumber', | ||
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin', | ||
platforms: ['iOS', 'Android'] | ||
}) | ||
export class CallNumber { | ||
/** | ||
* Calls a phone number | ||
* @param numberToCall {number} The phone number to call | ||
* @param bypassAppChooser {boolean} Set to true to bypass the app chooser and go directly to dialer | ||
*/ | ||
@Cordova({ | ||
callbackOrder: 'reverse' | ||
}) | ||
static callNumber(numberToCall: number, bypassAppChooser: boolean): Promise<any> { | ||
return; | ||
} | ||
} |