mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
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()
|
||||
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).
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user