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

getCurrentPosition not working in iOS 14.2 #230

Closed pushkal-symsoft closed 3 years ago

pushkal-symsoft commented 3 years ago

Everything was working until iOS 14.1. But in iOS 14.2, when the app is run for first time getCurrentPosition always returns error saying permissions were denied by the user. Popup for requesting permission from user comes up, however getCurrentPosition does not wait for user input and errors out in couple of seconds.

Code: await Geolocation.requestAuthorization('whenInUse'); Geolocation.getCurrentPosition( (position) => { console.log(position); }, (error) => { // See error code charts below. console.log(error.code, error.message); }, { enableHighAccuracy: true, timeout: 15000, maximumAge: 10000 } );

Side Notes:

pushkal-symsoft commented 3 years ago

Well it looks like upgrading to version 5 fixed it. The fact that version 4 was working with iOS 14.1 threw me off.