我们可以在后台启动iBeacon发射器吗?

编程入门 行业动态 更新时间:2024-10-07 18:28:01
本文介绍了我们可以在后台启动iBeacon发射器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个iPhone应用程序,我在其中创建了一个发射器和一个接收器。但是,当屏幕被锁定或应用程序被发送到后台时,发射器会停止发送。

I have an iPhone app, in which I have created a transmitter and a receiver, both. But, the transmitter stops transmitting when the screen is locked or the app is sent to the background.

我是否可以在后台继续发送(又称广告,广播) ?

Can I keep transmitting (a.k.a. advertising, broadcasting) while still in the background?

推荐答案

不幸的是,没有。 iOS确实允许蓝牙服务的背景广告,但仅使用打破iBeacon广告格式的专有技术。因此,如果您的应用程序开始作为iBeacon进行传输,然后切换到后台,它的传输仍然存在,但iBeacon探测器将不再接收它。有关详细信息,请参阅此处:

Unfortunately, no. iOS does allow background advertising of Bluetooth Services, but only using a proprietary technique that breaks the iBeacon advertising format. As a result, if your app starts transmitting as an iBeacon, then switches to the background, its transmission will still exist, but it will no longer be picked up by iBeacon detectors. See here for more information:

...您应该知道,当您的应用处于后台时,广告的运营方式与您的应用位于前台时的运营方式不同。特别是,当您的应用程序在后台进行广告时... [a]服务CBAdvertisementDataServiceUUIDsKey广告密钥值中包含的服务UUID被放置在一个特殊的溢出区域中;它们只能由明确扫描它们的iOS设备发现。

...you should be aware that advertising while your app is in the background operates differently than when your app is in the foreground. In particular, when your app is advertising while in the background ...[a]ll service UUIDs contained in the value of the CBAdvertisementDataServiceUUIDsKey advertisement key are placed in a special "overflow" area; they can be discovered only by an iOS device that is explicitly scanning for them.

底线是iOS设备无法作为iBeacons传输当他们在后台时。

The bottom line is that iOS devices cannot transmit as iBeacons when they are in the background.

更多推荐

我们可以在后台启动iBeacon发射器吗?

本文发布于:2023-11-05 10:22:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560572.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发射器   我们可以   后台   iBeacon

发布评论

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

>www.elefans.com

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