Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set range region iBeacons

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 !

like image 433
testoverblaireau Avatar asked Dec 28 '25 23:12

testoverblaireau


1 Answers

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.

like image 128
Duncan C Avatar answered Dec 31 '25 12:12

Duncan C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!