react-native-geolocation: Code : 2, Message: "unable to retrieve location", PERMISSION_DENIED:1,POSITION_UNAVAILABLE: 2. in IOS
Environment
Platforms
Versions
- Android:
- iOS:
- react-native-geolocation:
- react-native:
- react:
Description
Code : 2, Message: “unable to retrieve location”, PERMISSION_DENIED:1,POSITION_UNAVAILABLE: 2. in IOS simulator
Reproducible Demo
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 26
- Comments: 38
Click your simulator then Select Features > Location > Custom Location
same problem on real ios device
{"code":3,"message":"Unable to fetch location within 30.0s.","PERMISSION_DENIED":1,"POSITION_UNAVAILABLE":2,"TIMEOUT":3}
I have been getting this on ios, although it still gets the position@goodryanboy answer solved for me.
please turn on gps or location 👍
same problem on real android device
any solution?, i have same problem on real android device
Try the following
info.plist
AndroidManifest.xml
same problem on android device (not simulator)
so this problem is just on simulator?
SOLUTION
My location permission is working on every device
DONOT USE @react-native-community/geolocation
I simply use react-native-geolocation-service and it start working on every device of android
Permission
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
USE Library
https://github.com/Agontuk/react-native-geolocation-service
I am receiving this error on Android API 28 only. It works on API 29. Any idea why?
same issue with ios!