Beacon ranging when the device is idle

We are implementing indoor positioning and proximity sensing in our iOS app using iBeacons. We have placed multiple beacons to detect the proximity of one point of interest(POI). We are using the startRangingBeacons method in the CLLocationManager class and implementing corresponding delegates to receive the ranging information. With all required foreground and background permissions granted, when a user walks from one POI to another, beacon ranging is working as expected and we are continuously receiving the sightings in the app.

We have observed that, if user stops walking for a few minutes at a POI and then device automatically pauses the scan. Hence, we will not receive any beacon signals. When there is a movement, it performs beacon ranging again for a minute or so, then stops again for longer time even when user is walking. The interval between the pausing and resuming the service is not a constant. We have also observed that sometimes it takes more than 15 minutes to resume the service once the system pauses the ranging automatically. Is it an expected behavior? How long does it usually take for beacon ranging services to resume after the user starts moving? Is there any way we can reduce this delay between the pause and resume of ranging beacons?

Appreciate your support

Replies

Beacon ranging will only work if your app is running, and will pause if it gets suspended. All apps will get suspended when in the background after a short time, unless they are using an API that prevents this suspension. Using beacon ranging alone will not prevent suspension, and when your app stops executing, ranging will also stop.

The pausing and delay in the restart of ranging has nothing to do with the ranging API calls. What it seems like you are using some other API that is waking up your app with some movement, which gives you a short execution time now and then. So, you will need to re-evaluate whatever APIs you are using to trigger the app wake up based on movement, and either adjust the parameters, or use a different API that will cause the app to be woken up sooner.