Ranging beacons when app is killed or not even in background - is that possible?


#1

Hi there!

I would be really happy if my application could detect beacons when app is killed not even in background. It working fine when it is in background with one of this solution (Ranging beacons in background - is that possible?). Can any one help me with this (@r00dY)


#2

One solution would be to use monitoring to have your app relaunched if it’s killed and a beacon event (enter/exit) comes. And then, once your app gets relaunched into the background, you could range for a few seconds (no special work required), for up to 3 minutes (starting a background execution task required), or indefinitely (starting regular location updates required—you need a really good reason for that though, otherwise you’ll have your app rejected from the App Store!).

What app are you building? Why does it need to constantly range even if the user is not using it? Keep in mind this will drain the phone’s battery, as constant ranging is not as energy efficient as simple enter/exit monitoring.


#3

Thanks @heypiotr actually i want to generate map according to detected beacons even if i dont open app it will hit beacons and give me the result that how much time i have spent to particular place


#4

You should actually be able to do that with just monitoring, e.g.:

  1. I enter the range of the “kitchen” beacon.
  2. The app wakes up in the background with the “didEnter” event, saves the current time to the disk.
  3. I leave the range of the “kitchen” beacon.
  4. The app wakes up in the background with the “didExit” event, compares current time to the previous time; the difference = how much time I spent in the kitchen.

How to get indoor location postion when app runs in background