feat(ble): add wrapper for starting location notifications (#4399)

This commit is contained in:
Sawyer Schumacher 2022-11-04 14:43:28 -06:00 committed by GitHub
parent 6a97dc5e07
commit 755b28e325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -564,6 +564,37 @@ export class BLE extends AwesomeCordovaNativePlugin {
return;
}
/**
* Registers to be notified when Location service state changes on the device.
*
* @usage
* ```
* ble.startLocationStateNotifications(success, failure);
* // Or using await with promises
* // Note, initial promise resolves or rejects depending on whether the subscribe was successful
* await ble.withPromises.startLocationStateNotifications(success, failure)
* ```
* @returns {Observable<any>} Returns an Observable that notifies when Location is enabled or disabled on the device.
*/
@Cordova({
observable: true,
clearFunction: 'stopLocationStateNotifications',
clearWithArgs: false,
})
startLocationStateNotifications(): Observable<any> {
return;
}
/**
* Stop location state notifications.
*
* @returns {Promise<any>}
*/
@Cordova()
stopLocationStateNotifications(): Promise<any> {
return;
}
/**
* Open System Bluetooth settings (Android only).
*