Question

I am working with two iOS devices, one is set up as an iBeacon.

I am ranging the beacon with a second iOS device and can grab its state via:

-(void)locationManager:(CLLocationManager *)manager
       didRangeBeacons:(NSArray *)beacons
              inRegion:(CLBeaconRegion *)region{}

When I stop advertising on the iBeacon, the location manager on the second device continues to range/recognize the iBeacon for 5-10 seconds.

Is this expected behaviour?

Does the peripheralManager take time to wind down?

Was it helpful?

Solution

I have a setup with dedicated BTLE hardware running as iBeacons. Actually it takes 20-30s to stop calling locationManager:didRangeBeacons:inRegion: and after that it calls locationManager:didExitRegion:

In my understanding it makes sense and it's exactly what CL is looking for because the device needs some time to make sure it really exited the region. On the other hand, it starts ranging for beacons almost instantly after you fire the beacon up. There's no reason to wait to start ranging.

If you inspect the proximity property of the beacon you will notice that it's CLProximityUnknown during that time. Maybe you can do something with this state to do what you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top