react-native: PermissionsAndroid request returns "never_ask_again" on popup dismiss

Description

On Android 11, dismissing the request permission popup by tapping outside of it or by pressing the hardware back button will result on a never_ask_again answer even if the permission is still requestable (it actually should be equal to denied then).

On this version, the “Never ask again” checkbox disappear. The user have to press “Deny” twice to achieve the same effect. See https://developer.android.com/about/versions/11/privacy/permissions#dialog-visibility.

PS: Dismissing the popup isn’t the same as pressing the “Deny” button, since requesting the permission is possible after multiple (2+) popup dimiss.

I made a GIF to illustrate the issue:

Screen Recording 2020-10-11 at 19 11 46

React Native version:

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 2.07 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.8.0
    Yarn: 1.22.5
    npm: 6.14.8
    Watchman: 4.9.0
  Managers:
    CocoaPods: 1.9.3
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 21, 28, 29, 30
      Build Tools: 27.0.3, 28.0.3, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.2
      System Images: android-21 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: 21.3.6528147
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6821437
    Xcode: 12.0.1/12A7300
  Languages:
    Java: 1.8.0_265
    Python: 2.7.17
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.3 => 0.63.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

  1. Try to request a permission on Android 11+
  2. Dismiss the request popup by tapping outside of it or by pressing the hardware back button
  3. The request resolves with never_ask_again

Expected Results

The permission is still requestable: It should resolves with denied

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 6
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I am not even getting popup can anyone know why??

I am also facing this, I think it is specific to devices. In my case even the request permission pop is also not showing. I am facing this issue on android above 11.

Faced the same issue, found this: https://stackoverflow.com/a/73630987

I am also facing this, I think it is specific to devices. In my case even the request permission pop is also not showing. I am facing this issue on android above 11.

Same problem here. I am asking multiple permissions, CAMERA permission pop-up is opening and working fine, but for WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions pop-up is not even opening and returning never_ask_again. I think the issue is specific to devices because on majority of devices functionality is working, but on emulator and some devices, application is not functional due to this issue.