问题
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:
- Once connected to the peripheral, asking
peripheral.ancsAuthorized
returns alwaysfalse
at first, then after some reconnections it returns alwaystrue
, whatever is set the authorization switch before connecting to it. - 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 alwaystrue
, 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?
回答1:
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…
来源:https://stackoverflow.com/questions/57744189/cbperipheral-ancsauthorized-info-is-unreliable