How can I determine all geofences registered for an application?
After registering GeoFences with LocationClient.addGeofences()
,I waited for onAddGeofencesResuls()
(which returned SUCCESS) and tried to use LocationClient.getTriggeringGeofences(intent)
with the same intent I used for registration, but I only got null
.
I assume you are trying to compare the registered geofences with the ones that you have persisted in your own database.
I tried to do that as well with my app, but it seems like the API hints that this is not the way to go. So what I do now is just to simply register geofences, it will automatically replace those that I have registered before. And when some that I have registered fires, and I am supposed to remove them, I will remove them in the firing Intent.
Another possibility is to register all the geofences to have 24 hours time limit, and have the code register the geofences at least once everyday.