iBeacon ranging in the background?

后端 未结 3 1546
余生分开走
余生分开走 2021-01-20 18:35

I have started to test out iBeacons using estimotes as beacons.

It\'s all running pretty good, but i\'m struggling with getting the app to run properly in the backgr

3条回答
  •  没有蜡笔的小新
    2021-01-20 19:03

    You are mistaken. You don't need to call startUpdatingLocation in order to be called in the background.

    When you're in the background it takes longer to get notified when you enter a region. If you want ranging calls, you have to issue the startRangingBeaconsInRegion call as well. As the other poster pointed out, you will only get a few seconds of ranging calls from the background when a new beacon is detected. (You get a didEnterRegion, followed by a few ranging calls, and then your app goes back to sleep.)

提交回复
热议问题