I have been testing an app for many months which uses the Android Geofencing API to track enter/exit events. It works flawlessly about 99% of the time, but there are random times when the geofences simply do not trigger.
This cannot be an issue caused by my application failing to keep the geofences loaded, because whenever the fences fail to trigger, opening a completely separate GPS application, ie google maps, immediately causes my application to trigger the geofence event that it had failed to.
As I said, the geofences work flawlessly 99% of the time, and the other 1% simply opening another gps application immediately triggers the fences. I'm trying to figure out what I can do to eliminate the failing 1%, hopefully something short of constantly polling location (which makes the geofencing api pointless anyway).
Update: (Limited testing sample size of 1)On a device running Android Oreo, this issue seems to have become exacerbated to the point of geofences never triggering unless a secondary gps app is launched...
I don't know if this will help anybody but with the Background limitations starting from Android O the geofences work as you described, only opening apps that get the current location of the user will trigger the geofences.
You can create a Foreground service and poll the location from the Fused Location Provider in order to make Geofences to actually work.
I hope someone else found a better solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With