CBPeripheral.ancsAuthorized info is unreliable

烂漫一生 提交于 2020-05-13 14:31:51

问题


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?


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!