我希望在iOS上创建一个BLE广告,在此我可以在字节级别上控制该广告.
I'm hoping to create a BLE advertisement on iOS where I can control the advertisement on a byte level.
一个用例是模仿iBeacon广告.什么是iBeacon蓝牙配置文件(我想在我的应用程序处于运行状态时做广告背景,这就是为什么我不使用CoreLocation的原因
One use case would be to mimic an iBeacon advertisement. What is the iBeacon Bluetooth Profile (I want to advertise while my app is in the background which is why I'm not using CoreLocation)
我看不到使用Core Bluetooth API执行此操作的方法.这样对吗?是否有使用私有API或越狱的替代方法?
I do not see a way to do this with the Core Bluetooth API. Is this correct? Are there alternatives using private API's or jailbreaking?
推荐答案正如其他人已经指出的那样,iOS上没有API允许您执行此操作.
As the others already pointed out, there is no API on iOS that allows you to do this.
您可以作为iBeacon进行广告,但前提是您的应用程序处于前台.在后台时,广告将被删除,因此无法再被发现(其他iOS设备明确扫描该服务UUID除外).另请参阅此处的文档:核心蓝牙后台处理
You can advertise as an iBeacon, but only when your app is in the foreground. When in background, the advertisement is removed and therefore cannot be discovered anymore (except for other iOS devices which explicitly scan for that service UUID). Also see the documentation here: Core Bluetooth Background Processing
如果您要共享用例和要实现的目标,也许还有其他方法可以实现它.
If you would share your use case and what you want to achieve, maybe there are other ways to realise it.
更多推荐
iOS上的自定义BLE广告
发布评论