任何人都知道如何在不配对的情况下通过BLE在iOS上通过短字符串或字节数组进行传输?
根据我的研究,startAdvertise方法仅允许使用两个键:CBAdvertisementDataLocalNameKey
和CBAdvertisementDataServiceUUIDsKey
。>
https://developer.apple.com/documentation/corebluetooth/cbperipheralmanager/1393252-startadvertising
我也认为我可以使用
CBAdvertisementDataServiceDataKey: String
A dictionary that contains service-specific advertisement data.
附加数据,但似乎又是另一个死胡同WARNING: The advertisement key 'Service Data' is not allowed?
任何人都知道如何在不配对的情况下通过BLE在iOS上通过短字符串或字节数组进行传输?根据我的研究,startAdvertise方法只允许使用2个键...
[遗憾的是,您不能使用CoreBluetooth API将数据附加到广告。在iOS上,CBAdvertisementDataServiceDataKey是只读的。尽管Bluetooth LE允许附加服务数据,但Apple有效地禁止了第三方应用程序这样做。