According to the Android geofencing documentation one should re-register the geofences if the following cases occur:
- The device is rebooted.
Solution: The app should store the geofences internally (SharedPreferences) when the geofence is added. Then listen for the device's boot complete action, and re-register the stored geofences.
- The app is uninstalled and re-installed.
Solution: User should create the geofences again or store them remotely and then retrieve when the app opens for the first time.
- The app's data is cleared.
Solution: User should create the geofences again or store them remotely and then retrieve when the app opens for the first time.
However, I don't know what to do in the following cases, please can you advice?
Google Play services data is cleared. How can I detect this case?
The app has received a GEOFENCE_NOT_AVAILABLE alert. This typically happens after NLP (Android's Network Location Provider) is disabled. Not sure where this 'alert' is received