我有一个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发射器吗?
发布评论