Ibeacon case - trigger didEnterRegion with distance constraints

In a specific business case, I would like to trigger a proximity notification (push or UILocalNotification) using iBeacon technology. This is designed to work when the app is in background / locked screen.

I have certain limitations:

  • The product has to scale at a certain level, so it is impossible to cover 20 regions. We will only use one UUID (maybe 2 or 3 if we develop a new set of features, but we will not register a region for each physical beacon)

  • We will use primary and secondary to call web services

  • Regarding this, I know that I will have to use the following approach: first didEnterRegion: without prior major / minor / distance information, and then didRangeBeacon: perform more complex actions. I am already using local storage engines to time out the beacon after it has been used given the speed of the fast beacon beacon.

    * Basic limitations: we must have events relative to the distance of the beacon (for example, only trigger a notification if CLProximityImmediate)

Now I see the main limitation. Since my app will only appear in the background for a few seconds after being entered into a region, if I had distance / proximity based constraints, it is very possible that the app would:

  • go back to the background before the user approaches the physical beacon to trigger the event.
  • never starts up again because it has to re-enter the scope into the range, which probably won't happen

Do you have any ideas / work for such a case?

+3


source to share


1 answer


You are absolutely right about the restrictions CoreLocation

applied in this use case. If you configure it as you described, the typical behavior would be for the app to detect a beacon in the background at an unknown distance (often the maximum range is about 50 meters), the range in the background is about 5 seconds, then the app will be suspended by iOS. That five seconds of ranking time is usually not enough for the user to get close to the beacon to trigger your use case.

Unfortunately, there are no easy workarounds with standard beacons, and objects CoreLocation.

CLBeaconRegion

do not have a distance field, for example CLCircularRegion

for geophones.



Two more extreme approaches you can try:

  • Disable monitoring of your one region as soon as you find the device is too far away, then re-enable it as your app is suspended in the callback applicationWillResignActive:

    . You can get a new input event and more background time.

  • Use non-standard beacons that periodically stop their transmissions to trigger forced logout / write events.

+3


source







All Articles