askAsync SMS permissions return denied

Hi all,

The following snippet does not let the user grant sms permissions to my detached android app. No dialog is ever shown, but status.status === 'denied'is returned always. No problem on ios, Expo V31.

I am experiencing similar issues with requesting camera persmissions, see post here: Getting turned down by Permissions.askAsync(Permissions.CAMERA_ROLL)

Besides from those issues, everything works like a charm, great job team Expo!

  onSMSPress = () => {
    SMS.isAvailableAsync().then(isAvailable => {
      if (isAvailable) {
        Permissions.askAsync(Permissions.SMS).then(status => {
          if (status.status === 'denied') {
            this.alertPermissions();
          }
          if (status.status === 'granted') {
            this.alertBeforeSend();
          }
        });
      } else {
        this.alertNotAvailable();
      }
    });
  };

Cheers // Kristofer

Solved, but possibly in an unintended or undocumented way.

Editing the READ_SMS permission of AndroidManifest.xml manually, removing tools:node="remove" did the trick.

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