mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 561 forks source link

Accuracy issues when migrating from react-native-geolocation to react-native-background-geolocation #530

Open jsimonassi opened 3 years ago

jsimonassi commented 3 years ago

Environment

Context

I'm migrating my APP from the react-native-Geolocation package to react-native-background-geolocation, as I need to get the location even when the app is in the background.

My app is related to physical activity and I need to display a polyline with the user's locations during a run. The problem is that before I received a latitude / longitude value in this format:

React-native-Geolocation: “latitude”: -22.74197324331078 and now:
React-native-background-Geolocation: “latitude”: -22.7419732

Even with BackgroundGeolocation.HIGH_ACCURACY, I can't get a latitude / longitude value with more decimal places. The consequence of this is that the polyline is not rendered on some android devices.

To render the polyline on the map I am using react-native-maps

Is there something wrong with my configuration object? Is there a way to get a more accurate latitude / longitude?

I'm trying to solve a bug in production and I really need to make it work.