Skip to content

Commit

Permalink
feat(ble): add wrapper for starting location notifications (#4399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sschumac committed Nov 4, 2022
1 parent 6a97dc5 commit 755b28e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/@awesome-cordova-plugins/plugins/ble/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down

0 comments on commit 755b28e

Please sign in to comment.