Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.61k stars 292 forks source link

`getCurrentLocation` not working on IOS without timeout #244

Closed chungweileong94 closed 2 years ago

chungweileong94 commented 3 years ago

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.

mike-skwi commented 3 years ago

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

Agontuk commented 3 years ago

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

harshvitra commented 3 years ago

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

joaocarmo commented 3 years ago

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.

Agontuk commented 3 years ago

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

Agontuk commented 2 years ago

v5.3.0-beta.4 released, please check if it solves this issue.

Agontuk commented 2 years ago

Closing this as it should be fixed in latest version