Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9 didRangeBeacons called more times. iOS-8 it was once every second

didRangeBeacons method is almost getting called 40 times every second in iOS 9. However, in iOS 8 and below it was getting called only once every second. Because of this our code logic in didRangeBeacons is not working as expected.

Steps to Reproduce:

  1. To any of your ViewController or AppDelegate, add the CLLocationManager delegates.
  2. Initialise the location manager.
  3. Start ranging -

    [self.locationManager startRangingBeaconsInRegion:savedRegion];
    
  4. Just see how frequently didRangeBeacons is getting called.

Expected Results: Should get called once every second.

Actual Results: Is getting called more than 40 times every second

Version: iOS 9 and above

like image 457
Madhu V Swamy Avatar asked Jan 28 '26 14:01

Madhu V Swamy


1 Answers

Make sure you don't change any of the CLLocationManager properties in the didRangeBeacons method. This will cause the CLLocationManager calling the didRangeBeacons again and you will end up with lots of updates in a second.

I've experienced this with 'startUpdatingLocation' but should have the results.

like image 65
Sjoerd Perfors Avatar answered Jan 30 '26 04:01

Sjoerd Perfors



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!