React-native-geolocation-service: `getCurrentLocation` not working on IOS without timeout

Created on 16 Feb 2021  路  5Comments  路  Source: Agontuk/react-native-geolocation-service

On IOS, if the timeout is not set (default to infinity), the callback will never get called.

I looked into the native code, and I noticed that the recent v5.2.0 changed from locManager.requestLocation() to locManager.startUpdatingLocation(), which is also the root cause. I tried to revert the change, and everything works fine again.

Most helpful comment

Ran into this same thing today. Noticed when my callback wasn't happening until I added a timeout in the config

All 5 comments

Ran into this same thing today. Noticed when my callback wasn't happening until I added a timeout in the config

This is pretty weird, I also faced this. Don't know what could be the issue yet. I'll take a look.

Yes I am also facing the same trouble, if I remove the maximumAge it works

I've been having the same issue in my project. After reading this issue, adding the timeout option with some value fixed it for me.

For now, you have to add the timeout option. I'll rewrite the ios implementation soon, will try to address it then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexandersandberg picture alexandersandberg  路  7Comments

ravirajn22 picture ravirajn22  路  4Comments

matthieupinte picture matthieupinte  路  6Comments

Jaraujo6 picture Jaraujo6  路  6Comments

lyseiha picture lyseiha  路  6Comments