I am currently registering a location fence on my application, similar to how it is explained on the documentation. Using logs, I can see the registering callback and the broadcast receiver are being correctly called. However, if I re-run the application, these are not fired. After rebooting my phone it works again.
I am not unregistering the fence because I want the fence to be fired even in the background (the receiver is not tied to an Activity).
¿How can I get this working even if I re-run the application multiple times during application development? ¿How can I ensure the fence is correctly registered when a user reinstalls or updates the application?
I create the AwarenessFence using
AwarenessFence allLocations = AwarenessFence.or(locationFences);
where locationFences is a collection of LocationFence objects created like this
singleLocationFence = LocationFence.entering(latitude, longitude, FENCE_RADIUS);