0
votes

Am working on iBeacon app where I monitor and range beacon however, when the app start ranging for a beacon in region I get endless list of beacon range status as long as the user in the beacon range.

My question is when to send the server the beacon proximity!

And if someone could explain the optimal way to queue and send list of beacons events to web server! it will be much appreciated.

1

1 Answers

0
votes

The optimal way to send beacon proximity events to the server all depends on your business use case. Here are a few common options:

  1. Send an event whenever a new beacon identifier is first detected, along with the proximity at that time.

  2. Send an event periodically (say every 10 minutes) with a full list of beacons seen during that period along with their minimum/maximum proximities over that period.

  3. Send an event whenever the proximity crosses a threshold (e.g. send an event only when a unique beacon identifier first becomes in near or immediate proximity).

Implementing the above on iOS often involves tracking the detections in a Dictionary, and then triggering the server call at the appropriate logical time from the didRangeBeacons:inRegion callback based on what has been tracked so far in this dictionary. Using logic to implement 1, 2 or 3 above will ensure that the number of server calls will be limited.