react-native-geolocation-service: Location request timed out most of the time.

Im using getCurrentPosition to get user location with following params.

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

Most of the time response will be Location request timed out. Only after getting the user location I can generate data based on that. Is there any way to fix this issue or should i try any other libraries.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 8
  • Comments: 27 (5 by maintainers)

Most upvoted comments

Same issue happened but for iOS. On Android its working fine

I have this problem only with Android 10

If it’s android, some reported that opening google maps once will solve this issue. For iOS, I’m not sure what the issue could be. Are you using emulator or actual device?

If it’s android, some reported that opening google maps once will solve this issue. For iOS, I’m not sure what the issue could be. Are you using emulator or actual device?

Opening Google Maps (and getting direction from current location to any random location) works fine! First couple days when I installed this library, everything was okay. And then all my location requests were rejected due to timeout issue. I don’t think this solution (mostly workaround) will require same efforts from other customers. If yes, this thing is inappropriate:-/

It seems that with regards to the issue that I’m seeing (timeouts, error code 3) if you unset maxAge to undefined, it will retrieve the last location found via google maps. However, it won’t retrieve updated locations until google maps is opened again.

The default value for distanceFilter is set to 0 meters, which might be causing this issue. It also doesnt make sense in low accuracy situations. I tried setting it to something like 250 meters and that fixed it for me. Might just be coincidence though.