为iOS附加广告有效负载而不进行配对

问题描述 投票:0回答:1

任何人都知道如何在不配对的情况下通过BLE在iOS上通过短字符串或字节数组进行传输?

根据我的研究,startAdvertise方法仅允许使用两个键:CBAdvertisementDataLocalNameKeyCBAdvertisementDataServiceUUIDsKey。>

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个键...

android ios bluetooth-lowenergy ibeacon
1个回答
0
投票

[遗憾的是,您不能使用CoreBluetooth API将数据附加到广告。在iOS上,CBAdvertisementDataServiceDataKey是只读的。尽管Bluetooth LE允许附加服务数据,但Apple有效地禁止了第三方应用程序这样做。

© www.soinside.com 2019 - 2024. All rights reserved.