feat(ble): support startStateNotifications & stopStateNotifications (#2085)

This commit is contained in:
mburger81 2017-12-02 05:00:13 +01:00 committed by Ibby Hadeed
parent d95ae68c9c
commit 2a4bcee6a0

View File

@ -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).
*