Skip to content

Commit

Permalink
feat(ble): support startStateNotifications & stopStateNotifications (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mburger81 authored and ihadeed committed Dec 2, 2017
1 parent d95ae68 commit 2a4bcee
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/@ionic-native/plugins/ble/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,33 @@ export class BLE extends IonicNativePlugin {
@Cordova()
isEnabled(): Promise<void> { return; }

/**
* Register to be notified when Bluetooth state changes on the device.
*
* @usage
* ```
* BLE.startStateNotifications().subscribe(state => {
* console.log("Bluetooth is " + state);
* });
* ```
*
* @return Returns an Observable that notifies when the Bluetooth is enabled or disabled on the device.
*/
@Cordova({
observable: true,
clearFunction: 'stopStateNotifications',
clearWithArgs: false
})
startStateNotifications(): Observable<any> { return; }

/**
* Stop state notifications.
*
* @returns {Promise<any>}
*/
@Cordova()
stopStateNotifications(): Promise<any> { return; }

/**
* Open System Bluetooth settings (Android only).
*
Expand Down

0 comments on commit 2a4bcee

Please sign in to comment.