Please provide the following:
- SDK Version: 35
- Platforms(Android/iOS/web/all): iOS
On press of a button, I am calling a function that gets the user’s location, but checks their permission before doing so.
// inside button press function
const { status } = await Permissions.getAsync(Permissions.LOCATION);
if (status != "granted") {
Alert.alert(
"Permissions",
"You need to enable location permissions for the application first. To do this, go to Settings on the device, find the application and enable Location permissions.",
[
{
text: "Ok"
}
],
{
cancelable: false
}
);
return;
}
If I disable permissions, start the app and press the button, I see the alert as expected. However, if I minimize the app, open Settings and enable Location permissions, return to the app and press the button again, it still returns that permissions are denied. In fact, I seem to have to fully close and restart the app for the new permission status to be returned correctly. Am I going about this wrong?