Please provide the following:
- SDK Version: 37.0.0
- Platforms(Android/iOS/web/all): Android
I am trying to get the user to give LOCATION permission in the app but the permissions dialog never opens. In the code below, none of the console.log statements is getting executed. Somehow as soon as I request permission using askAsync(…) it never moves ahead of that step. Can anybody please help.
I am running the code on snack.expo.io
I also created a build for android and installed the apk on an Android device but same result. I have added the permission in the app.json file.
code:
_getLocationAsync = async() => {
let {status} = await Expo.Permissions.askAsync(Expo.Permissions.LOCATION)
console.log(“Location Permission” + status)
if(status !== ‘granted’){
console.log(“Permission not granted”)
return;
}
console.log(“Permission granted”)
let location = await Expo.Location.getCurrentPositionAsync({});
this.setState({location});
}