Open muslimmuda15 opened 1 month ago
Sometimes, my app want to getting current location to user but not every time is successful.
Geolocation.getCurrentPosition( ({ coords: { latitude, longitude, accuracy } }) => { setUserLoc({ ...userloc, latitude, longitude, accuracy, }); Geolocation.watchPosition( ({ coords: { latitude, longitude, accuracy } }) => { setUserLoc({ ...userloc, latitude, longitude, accuracy, }); }, error => { console.log('watch user position: ', error); sendToSlack( 'Error Watching Location on _getCurrentPosition App.js', error, ); }, { enableHighAccuracy: true, timeout: 20000, maximumAge: 5000, distanceFilter: 10, }, ); setTimeout(() => Geolocation.clearWatch(), 300000); }, error => { console.log('error accessing location: ', error); }, { enableHighAccuracy: true, timeout: 20000, maximumAge: 5000 }, );
I think it will be success in first time only. another time it will be error like this:
{ "code": 3, "message": "Unable to fetch location within 20.0s.", "PERMISSION_DENIED": 1, "POSITION_UNAVAILABLE": 2, "TIMEOUT": 3 }
I have set NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription in my info.plist Please help
NSLocationAlwaysUsageDescription
NSLocationAlwaysAndWhenInUseUsageDescription
info.plist
Im having the same issue i have to close and reopen the app completely for it to work again
++
Sometimes, my app want to getting current location to user but not every time is successful.
I think it will be success in first time only. another time it will be error like this:
I have set
NSLocationAlwaysUsageDescription
andNSLocationAlwaysAndWhenInUseUsageDescription
in myinfo.plist
Please help