JBA
JBA

Reputation: 2909

CBPeripheral.ancsAuthorized info is unreliable

Our app works with a paired Bluetooth peripheral that uses ANCS, that is why I dug early into the brand new privacy setting "Share System Notifications" to make our app ready for iOS13... However there is an issue, the CBPeripheral property ancsAuthorized(Bool) is unreliable, so then it is impossible to know if the user granted the authorization or not. It is unreliable in 2 ways:

  1. Once connected to the peripheral, asking peripheral.ancsAuthorized returns always false at first, then after some reconnections it returns always true, whatever is set the authorization switch before connecting to it.
  2. The second case, when using the new CBCentralManager delegate didUpdateANCSAuthorizationFor:cbperipheral : it is fired successfully each time I play with the setting switch (located in the iOS > Bluetooth > Device Settings), but unfortunately, the result of peripheral.ancsAuthorized is always true, wether I switch the authorization on or off :(

I posted a sysdiagnose file and complete description to the Apple Feedback Assistant, helped by a dedicated support ticket, but so far it remains open with no news at all…

Did anyone had a chance to play with this new privacy setting successfully?

Upvotes: 2

Views: 979

Answers (2)

Carlos Chaguendo
Carlos Chaguendo

Reputation: 3085

add CBConnectPeripheralOptionRequiresANCS to option when connect.

centralManager.connect(peripheral, options: [
      CBConnectPeripheralOptionRequiresANCS: true
 ])

Upvotes: 0

JBA
JBA

Reputation: 2909

It looks like after installing iOS 13.1 beta 2 the problem numner 2 has been fixed by Apple. However the first issue, that is getting the status of that authorization once connected to a CBPeripheral, is still random, sometimes it returns always true, sometimes always false…

Upvotes: -1

Related Questions