0

I am developing react-native for the first time and I cannot say that I fully understand the location API. Location API has values ​​from 1 to 6 for accuracy and I want to get the GPS accuracy value instantly and show a warning if the value is less than 4. How can I achieve this?

expo-location version: 13.0.4 Platform: IOS, android

OyeeRatio
  • 125
  • 1
  • 8
  • This should help https://stackoverflow.com/questions/55393271/react-native-how-to-auto-fetched-the-otp-in-the-textfield-from-the-mobile-sms-sh/56223148 – Dipansh Khandelwal Nov 29 '21 at 19:32

1 Answers1

4

When you call Location.getCurrentPositionAsync(options) the response object contains "accuracy" key which you can use to get value of accuracy.

Moreover if you need to add check for GPS accuracy it would be better to use Location.enableNetworkProviderAsync(), it asks the user to turn on high accuracy location mode.

Shabbir Haider
  • 158
  • 3
  • 10