- SDK Version: 38
- Platforms
Android: 10
Hello, talents.
Now I am developing an app using Expo v38 and it is using expo-location library.
I want to use this service only while using this app.
But when selecting the “Allowed Only While in USE”, it returns “denied” status.
The location service is working only by chooing “Allowed All the Time”.
This is my codebase.
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if (status != "granted") {
this.setState({
errorMsg: "Permission to access location was denied",
loading: false
});
} else {
let location = await Location.getCurrentPositionAsync({
enableHighAccuracy: true
});
this.setState({ currentLocation: location });
}
Can someone help me?
Thanks.