cordova-plugin-ble-central icon indicating copy to clipboard operation
cordova-plugin-ble-central copied to clipboard

Detect Bluetooth autorisation for IOS 13.1 +

Open dufrenb opened this issue 3 years ago • 2 comments

Since IOS 13.0, Bluetooth requires user permission but first they forgot to give us a way to check for autorisation without asking for them. In IOS 13.1, Apple provide us à way to do that. See https://developer.apple.com/documentation/corebluetooth/cbmanager/3377595-authorization?changes=latest_major.

Is it possible to implement this ?

dufrenb avatar Sep 06 '21 17:09 dufrenb

Hi @dufrenb , this is somewhat non-trivial to implement in the plugin currently. The CBManager is initialised as soon as the plugin is loaded, which automatically prompts the authorisation request.

See https://github.com/don/cordova-plugin-ble-central/blob/f5569e48262da901ee3b82b81ade3c73c5418f8b/src/ios/BLECentralPlugin.m#L41

I'm happy to consider patches to address this however, if a solution can be found that doesn't require too much code there to be refactored.

peitschie avatar Nov 15 '21 22:11 peitschie

Just noting, this is related to these discussions

  • https://github.com/don/cordova-plugin-ble-central/pull/769
  • https://github.com/don/cordova-plugin-ble-central/pull/735
  • https://github.com/don/cordova-plugin-ble-central/issues/739#issuecomment-619149028

peitschie avatar Feb 25 '22 08:02 peitschie