问题出在标题中。 如果应用程序被用户杀死,新的Android Geofences是否会被删除?
我正在使用新的Android Geofences(在Google IO 2013上宣布)。如果用户使用Android任务管理器删除/杀死应用程序,那么如果应用程序的Geofences被删除,我就无法解决问题。我认为使用旧的addProximityAlert技术不会删除它们。
答案 0 :(得分:2)
我相信答案是否定的。如果用户杀死应用程序,应用程序崩溃或应用程序被任务管理器杀死,则注册的地理围栏将不会被删除。我知道您注册Geofence的旗帜为NEVER_EXPIRE,即使卸载了应用程序,Geofence注册也会保留。
我的理解是注册的地理围栏必须到期或取消注册才能在不重新启动手机的情况下删除。
答案 1 :(得分:2)
从我的测试来看,情况并非如此。卸载应用程序时会删除它们。
谷歌确实需要一个api,让你可以获得你注册的所有围栏......这会让事情变得更好。
答案 2 :(得分:2)
宣布为here:
如果在以下事件发生后仍需要地理围栏,应用必须重新注册地理围栏,因为在以下情况下系统无法恢复地理围栏:
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.