transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.65k stars 426 forks source link

Getting how closer to the closest Geofence #1215

Closed tharakanwn2014 closed 3 years ago

tharakanwn2014 commented 3 years ago

Your Environment

Expected Behavior

Actual Behavior

Steps to Reproduce

1. 2. 3. 4.

Context

Is there a way to get the distance to the closest geofence with the plugin?

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
christocracy commented 3 years ago

There is no built-in method for this. I suggest you listen to event onGeofencesChange to receive the list of currently monitored geofences (max 20 for iOS; 100 for Android). Iterate through this list and calculate distance yourself.

Seodiddy commented 3 years ago

ok thank you