Duplicate delegate calls for region monitoring

Originator:bill
Number:rdar://12452255 Date Originated:10-08-2012
Status:Open Resolved:
Product:iOS Product Version:6.0
Classification: Reproducible:YES
 
08-Oct-2012 08:25 AM Bill Burgess:
Summary:
Since iOS 4, the delegate methods for region monitoring, -didEnterRegion and -didExitRegion, will occasionally be called 2-3 times when a region is tripped. The calls are usually on one or the other, but rarely both. It has the unintended consequence of calling the delegate method twice and performing specific logic twice that should only be performed once.

Steps to Reproduce:
Add region to be monitored, register for delegate method calls, background the application, trigger geofence boundary, observe duplicate delegate calls.

Expected Results:
-didEnterRegion and -didExitRegion delegate methods should only be called once per boundary crossing.

Actual Results:
-didEnterRegion and -didExitRegion delegate methods are called multiple times on what appears to be a random basis.

Regression:
I have observed this issue going back to iOS 4 and the initial implementation of region monitoring.

Notes:
I have always been concerned it was my code causing the issue, but after speaking with other developers, they have witnessed the same issue. I am using a singleton for my location controller to rule out having multiple delegates registered.

I created a demo project outlining this bug on GitHub. https://github.com/wlburge/GeofenceBug

Comments

Glad to find this. I am also seeing this issue. I consistently get 3 calls to didExitRegion after a region is tripped. Did you make any progress on this?


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!