feat(ble): support startStateNotifications & stopStateNotifications (#2085)
This commit is contained in:
parent
d95ae68c9c
commit
2a4bcee6a0
@ -417,6 +417,33 @@ export class BLE extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
isEnabled(): Promise<void> { return; }
|
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).
|
* Open System Bluetooth settings (Android only).
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user