本文介绍了CBPeripheral.ancs授权信息不可靠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序可与使用ANCS的配对蓝牙外围设备一起使用,这就是为什么我要尽早研究全新的隐私设置共享系统通知以使我们的应用程序可用于iOS13的原因...
但是有一个问题,CBPeripheral属性是不可靠,因此不可能知道用户是否授予了授权。这有两种方式不可靠:

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. 连接到外围设备后,询问
    peripheral.ancsAuthorized 首先总是返回 false ,然后在重新连接后总是返回 true ,无论设置了什么

  2. 第二种情况,当使用新的CBCentralManager
    委托:每次我使用设置开关播放时,都会成功触发
    (位于iOS> Bluetooth >设备设置),但不幸的是,
    peripheral.ancsAuthorized 的结果始终是
    true ,无论我是否打开或关闭授权:(

  1. Once connected to the peripheral, askingperipheral.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 CBCentralManagerdelegate didUpdateANCSAuthorizationFor:cbperipheral : it is firedsuccessfully each time I play with the setting switch (located in the iOS > Bluetooth > Device Settings), butunfortunately, the result of peripheral.ancsAuthorized is alwaystrue, wether I switch the authorization on or off :(

我已将sysdiagnose文件和完整的说明发布到Apple Feedback Assistant,借助专用的支持票获得了帮助,但到目前为止它仍然是开放的,根本没有任何新闻……

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?

推荐答案

在安装iOS 13.1 beta 2之后,Apple修复了问题编号2。
但是,第一个问题,即连接到CBPeripheral时获得授权状态,仍然是随机的,有时返回的始终为true,有时始终为false…

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…

这篇关于CBPeripheral.ancs授权信息不可靠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 12:36