diff --git a/src/@awesome-cordova-plugins/plugins/ble/index.ts b/src/@awesome-cordova-plugins/plugins/ble/index.ts index 4c47232ad4..6ec27e78da 100644 --- a/src/@awesome-cordova-plugins/plugins/ble/index.ts +++ b/src/@awesome-cordova-plugins/plugins/ble/index.ts @@ -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} Returns an Observable that notifies when Location is enabled or disabled on the device. + */ + @Cordova({ + observable: true, + clearFunction: 'stopLocationStateNotifications', + clearWithArgs: false, + }) + startLocationStateNotifications(): Observable { + return; + } + + /** + * Stop location state notifications. + * + * @returns {Promise} + */ + @Cordova() + stopLocationStateNotifications(): Promise { + return; + } + /** * Open System Bluetooth settings (Android only). *