0

I have an app that monitors or ranges iBeacons inside a building. How can I detect how long a user spends in a particular room?

I've observed that the proximity for a given beacon may jump from near to far, based on orientation of the device. This means that I cannot simply say that once the range is unknown, the visit is over. Should I continuously range a distance to a beacon and consider the visit to start/end once I detect X consecutive "near/unknown" states for a given beacon?

1 Answer 1

1

There is no guarantee you will get any number of ranging callbacks with proximity "unknown" before a beacon disappears. Instead, you should use the monitoring APIs, and consider a room exited when you get a call to didExitRegion. Sometimes iOS will give you a spurious exit notification, so you need to protect against this. I do so by starting a timer on region exit, and I only perform the exit logic if I don't get a didEnterRegion callback within five seconds.

Of course, all this assumes that the "room" or "department" has beacons whose transmitter range end precisely at the edge of the room/department. Without very precise placement and control over transmitter power, this is unlikely to be exactly true. You have to decide if you can live with this approximation.

2
  • I'm not sure if region monitoring would work for rooms with overlapping beacon signals -It's like one large region, and no guarantee that the user ever exits it. To distinguish beacons in such case, I would have to create distinct UUIDs for beacons, and register to listen for a dozen different regions.
    – Alex Stone
    Jun 30, 2014 at 11:29
  • @AlexStone, totally agree that different regions would be needed for each room/department. Jun 30, 2014 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.