Question

I need to sync with my server when the user exits a geofence, but I'm concerned what happens if the user has his phone turned off and the geofence would never fire the exit notification.

I was thinking about adding a passive location listener that fires if the distance is more than specified.

Is there a better way?

Was it helpful?

Solution

center of a circle is your main_point from which you consider geofence and radius of the circle is your distance in which you do not want show event.but when user move out of circle you want to fire event.

solution when user on his phone find his current latitude and longitude and the distance of this latitude and longitude from the main_point(center of the circle (static latitude and longitude )) and if this distance is more than radius it means user cross the geofence region and you fire event.

Finding distances based on Latitude and Longitude

mark the answer solve if it helps you so that other can find relevent answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top