Skip to content

Commit

Permalink
feat(call-number): add support for CallNumber plugin (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed authored Aug 27, 2016
1 parent 841b242 commit 759f8ef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Brightness } from './plugins/brightness';
import { BLE } from './plugins/ble';
import { BluetoothSerial } from './plugins/bluetoothserial';
import { Calendar } from './plugins/calendar';
import { CallNumber } from './plugins/call-number';
import { Camera } from './plugins/camera';
import { CameraPreview } from './plugins/camera-preview';
import { CardIO } from './plugins/card-io';
Expand Down Expand Up @@ -145,6 +146,7 @@ BatteryStatus,
Brightness,
BLE,
BluetoothSerial,
CallNumber,
CameraPreview,
Clipboard,
CodePush,
Expand Down Expand Up @@ -210,6 +212,7 @@ window['IonicNative'] = {
BLE: BLE,
BluetoothSerial: BluetoothSerial,
Calendar: Calendar,
CallNumber: CallNumber,
Camera: Camera,
CameraPreview: CameraPreview,
CardIO: CardIO,
Expand Down
36 changes: 36 additions & 0 deletions src/plugins/call-number.ts
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;
}
}

0 comments on commit 759f8ef

Please sign in to comment.