Closed patkozlowski closed 5 years ago
Marking this as closed. Turns out an AdBlocking app was highjacking location request for some odd reason, and the Geofence would not start about 10% of the time, and RequestState was not called. Make sure any adblocking VPNs, especially on iOS is turned off for this to work properly.
Also, to add on to this. I've eliminated the hardcoded 2-second delay by requesting the state in DidStartMonitoring for a region by the first response of this. Of course the 2-second delay works, but I think this is a better way to remedy.
void DidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
{
locationManager.RequestState(e.Region);
CrossGeofence.GeofenceListener.OnMonitoringStarted(e.Region.Identifier);
}
I see why they put a delay timer directly after requesting the state per the stackoverflow link, but still sometimes, RequestState & DidDetermineState doesn't get called. Anyway to remedy this any further, or even give a way to detect RequestState & diddeterminestate doesn't fire (through GPS strength, etc). Seems to happen too when the geofences are saved (persistant) when you launch the app. Has anyone encountered this?