0

Im using react-native-geolocation-service to get the user location and populate data based on user location. But most of the time Im getting Location request timed out error as response.

These are the options im using

enableHighAccuracy: false,
timeOut: 15000,
maximumAge: 10000,

I have tested in IOS emulator and its working fine. So far issue is only with Android device. How can i solve this issue.

Salman
  • 389
  • 4
  • 22

2 Answers2

0

I think this error could be because the Permissons are not set to access the phones Geo Location..

check out this answer How do I request permission for Android Device Location in React Native at run-time? to set the permission in run time or look up on how to set it inside the android folder to be permanent.

Faded.

yesIamFaded
  • 1,970
  • 2
  • 20
  • 45
  • permission is set correctly. im not getting this error all the time. but once i get it even after restarting the app i still get the same error. if i try again after some time i might get the correct location – Salman Apr 23 '20 at 13:41
0

Its may be because location permissions. select "Allow all the time" instead of "Allow while using the app"and try it.