16

The question is in the title. Do the new Android Geofences get removed if the app is killed by the user?

I am using the new Android Geofences (announced at Google IO 2013). I can't quite work out if the app's Geofences get removed if the user removes/kills the app using the Android task manager. I think with the old addProximityAlert technique they were not removed.

4

3 回答 3

4

As declared here:

The app must re-register geofences if they're still needed after the following events, since the system cannot recover the geofences in the following cases:

The device is rebooted. The app should listen for the device's boot complete action, and then re- register the geofences required.
The app is uninstalled and re-installed.
The app's data is cleared.
Google Play services data is cleared.
The app has received a GEOFENCE_NOT_AVAILABLE alert. This typically happens after NLP (Android's Network Location Provider) is disabled.
于 2015-11-21T17:03:15.147 回答
2

I believe the answer to this is no. A registered Geofence will not get removed if the user kills the app, if the app crashes or if the app is killed by a task manager. I know that is you register a Geofence with the flag NEVER_EXPIRE the Geofence registration will stay even if the application is uninstalled.

My understanding is the registered Geofence must reach expiration or be de-registered in order to be removed without rebooting the phone.

于 2013-08-08T05:17:57.513 回答
2

From my testing this isn't the case. They get removed when uninstalling the app.

Google really needs to have an api that lets you get all the fences you have registered... That would make things much better.

于 2013-10-24T18:32:07.937 回答