iOS 10.0+上的蓝牙授权(ExternalAccessory)问题

时间:2016-10-29 17:07:15

标签: bluetooth xamarin.ios ios10 entitlements external-accessory

每次我尝试通过iOS 10.0+(本机或Xamarin)上的ExternalAccessory SDK列出连接的蓝牙配件时,我会收到以下日志消息:

Couldn't find the "com.apple.private.externalaccessory.showallaccessories" entitlement

(SWIFT)

let devices = EAAccessoryManager.shared().connectedAccessories

(Xamarin.iOS)

var devices = EAAccessoryManager.SharedAccessoryManager.ConnectedAccessories;

我的Info.plist看起来像:

<key>UIBackgroundModes</key> <array> <string>external-accessory</string> <string>bluetooth-peripheral</string> <string>bluetooth-central</string> </array>

<key>NSBluetoothPeripheralUsageDescription</key> <string>BT</string>

和示例UISupportedExternalAccessoryProtocols

<key>UISupportedExternalAccessoryProtocols</key> <array> <string>com.getpebble.public</string> </array>

我在Xcode中使用自动签名,问题仅发生在iOS 10.0+(本机和Xamarin)上,&lt; 10.0没有这样的问题。

更重要的是,尽管存在这个问题,我仍然可以获得连接设备列表,但是我无法写入\ read stream(我假设因为权利):

ERROR - /BuildRoot/Library/Caches/com.apple.xbs/Sources/ExternalAccessory/ExternalAccessory-353/EAOutputStream.m:-[EAOutputStream write:maxLength:] - 283 failed to write because stream does not have space available

我检查了第三方库(pebbleiZettle,它们也使用了ExternalAccessory SDK,我也遇到了com.apple.private.externalaccessory.showallaccessories问题。

我错过了什么吗?有谁知道解决方案?谢谢!

0 个答案:

没有答案