Geofence entry event received when permissions changed but, user never left the fence

49 Views Asked by At

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.

  1. I configured the geofence for 500m
  2. Started monitoring fence.
  3. Changed the region radius to 3000m
  4. Saved the fence and started monitoring region.
  5. Walked for about 200m from the center of the geofence.
  6. Changed the permissions of the location services for the app from "Always" to "Never"
  7. Instantly changed the permission back to what they were i.e. "Always"
  8. 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.

0

There are 0 best solutions below