Permission status never updates, requires app restart

Please provide the following:

  1. SDK Version: 35
  2. 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?

Hey @cshanno, is this occurring in the Expo client or the standalone version of your app?

Cheers,
Adam

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.