I am trying to use CBCentralManager
in watchOS to scan for BLE devices.
I use the following code to start the scanning process:
centralManager = CBCentralManager(delegate: self, queue: nil, options: [CBCentralManagerOptionShowPowerAlertKey: true])
This causes the following function to be called (as expected):
internal func centralManagerDidUpdateState(_ central: CBCentralManager) {
Problem: central.state
is always .unauthorized
I have included Privacy - Bluetooth Always Usage Description
and Privacy - Bluetooth Peripheral Usage Description
in info.plist for both the watchApp and watchAppExtention.
Is there something else that I should be doing (eg, include something in the entitlement file)? My app is not a peripheral; it is supposed to be in the "central" mode in foreground (not background).
Thanks!