I was testing geofence monitoring in my iOS App, and suddenly this method was called locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion)
It was a misbehavior for me because I never left the region which was currently monitored. (occurred only once)
Steps I followed while the issue was faced.
- I configured the geofence for 500m
- Started monitoring fence.
- Changed the region radius to 3000m
- Saved the fence and started monitoring region.
- Walked for about 200m from the center of the geofence.
- Changed the permissions of the location services for the app from "Always" to "Never"
- Instantly changed the permission back to what they were i.e. "Always"
- And I received geofence entry event at this instant. (Although I was never able to reproduce this issue.)
It was a strange behavior for me, And I was unable to handle this kind of event.
Q1. Is there any way I can detect if I have not crossed the fence so I can verify when I receive an entry on any fence.
When I checked the behavior with Android OS, I was happy to see "setInitialTrigger" method in geofence request which will handle if the entry/exit/dwell was initial or not.
Q2. Is there anything similar to INITIAL_TRIGGER_ENTER in iOS.