iOS上的自定义BLE广告

编程入门 行业动态 更新时间:2024-10-08 08:31:07
本文介绍了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广告

本文发布于:2023-11-28 04:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640985.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   广告   iOS   BLE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!