iOS上的自定义BLE广告 [英] Custom BLE Advertisement on iOS

查看:73
本文介绍了iOS上的自定义BLE广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在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广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆