iOS - iBeacon - Advertise (Broadcast) as beacon in Background after iOS 7.1 update

风流意气都作罢 提交于 2019-12-14 02:00:31

问题


I am trying to make an Application using iBeacon in which One device will work as beacon Broadcaster and another one as Receiver.I gone through the similar thing in Run iPhone as an iBeacon in the background but the solution that present there is not for API of iBeacon so i am asking this thing again.

I succeed in being notified on Detector Device(receiver) even the App is in Background or in Quit mode. but Whenever Broadcaster Device's App goes in Background it stops Broadcasting packets and become no more as beacon. When it comes back in Foreground it again works fine. So the issue is Broadcaster has to be always in Foreground to Act as Advertiser or Broadcaster.

Is there anyway to advertise/Broadcast packets of iBeacon's even when App is in background mode.

I have enabled capabilities "Location Update" and "Acts as a Bluetooth LE accessory" from xCode.


回答1:


Unfortunately, it is simply not possible to advertise as an iBeacon in the background on iOS. For an explanation as to why, see here: Can we start iBeacon transmitter in background?




回答2:


Apple doesn't authorize it, it would be a mean to track an user which is quite against Apple current policy to preserve users' privacy.

The capabilities "Acts as a Bluetooth LE accessory" is to enable your application to continue being used as a bluetooth device (with a connection) when the app go in background mode. Advertising isn't a connected usage of bluetooth and isn't concerned by this capabilities.



来源:https://stackoverflow.com/questions/24509822/ios-ibeacon-advertise-broadcast-as-beacon-in-background-after-ios-7-1-upda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!