Is there any difference in accuracy using navigator.geolocation.getCurrentPosition() for geolocation vs a purely native call on Android or iOS?
1 Answers
short answer: yes it looks as accurate. But need to confirm how to enable high accuracy on iOS. Best way to verify for yourself is to compare the results retrieved against those of a native app (google maps, strava, etc).
from my own experience to implement a fitness tracker: getCurrentPosition is very inaccurate by itself unless you are already running watchPosition at the same time. Probably because getCurrentPosition turns the GPS on and off, and doesn't have time to get a good GPS fix, while watchPosition keep the connection opened all the time. (there is probably a more accurate/better explanation but that satisfies me for the moment) I use both watchPosition and getCurrentPosition together to be able to retrieve location details exactly every X seconds. In the callback method for watchPosition I do nothing.
It works quite well on android (I get similar results to Strava, with an accuracy of 5/10 meters). Although I cannot make it work on iOS yet: if I run my application alone, i get an accuracy of >50 meters . If Strava is running at the same time, suddenly the accuracy retrieved in my app is 5/10 meters. I need to find a way to enable high accuracy on iOS (though I am already asking high accuracy with the navigator.geolocation api).

- 1,267
- 12
- 33
-
any luck finding out how to get high accuracy on iOS? I'm having the exact same problem – Uri Klar Mar 13 '18 at 06:59
-
1sorry no satisfying answer to give you as I told you on https://stackoverflow.com/questions/43629524/react-native-ios-geoloc-has-poor-accuracy-by-default/43639144 did you use those in your app info.plist?
NSLocationAlwaysUsageDescription UIBackgroundModes UIRequiredDeviceCapabilities – Jeremie Mar 18 '18 at 13:52