I'm having some major problems with iBeacons.
I can't figure out at all how I control the distance that triggers some sort of event (like the notification). I'm only allowed to send notification when i enter or exit region but i'd like to send notification when i'm near or immediate/
Where am I missing these things in the documentation ?
Thx !
The short answer is that you can't. Beacons enter the region as soon as the beacon is detected.
What you can do is to turn on both enter/exit notifications AND beacon ranging. Then in your app's handler for locationManager:didRangeBeacons:inRegion: you can either use the proximity property (far/near/immedate) or use the "Accuracy" reading (which is really a badly named approximate distance reading.)
You would ignore the ranging notices until you decide the user is close enough.
However, there's a big problem with this. If your app is in the background, you get a didEnterRegion notice, followed by about 5 seconds of ranging message. Then the ranging messages stop and your app goes back to sleep. After those 5 seconds you won't get any more notifications about that region until the user exits it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With