Skip to content

Ask Every Time doesn't work if the user updates from Denied to Ask Every Time #14

@jmcgee412

Description

@jmcgee412

Description of the bug

If the user chooses "Not Allow" twice, the permission becomes denied like it is supposed to. But if the user opens the settings afterwards and changes it to "Ask Every Time" then CheckPermission() will still show as Denied instead of ShouldAsk, and RequestPermission() will not pull up the request. It will basically continue to act like it is still denied

Reproduction steps

  1. Create a project to ask for a permission (I was requesting the Camera).
  2. Choose "Not Allow"
  3. Request the permission a second time and choose "Not Allow" again
  4. Then go into the settings (either using the OpenSettings() call or by manually long pressing the app and selecting App Info)
  5. Change the permission from Not Allowed to Ask Every Time
  6. Go back to the app and CheckPermission will still show as Denied. And calling RequestPermission will not work
  • Interestingly here, Unity's RequestUserPermission() call WILL work here to bring up the permission request again (but that's not super helpful because Unity's version still shows it as Denied if you check the permission, and Unity's version has other inconsistent issues)

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 2020.3.48f1
  • Platform: Android (Unity build on Windows)
  • Device: Samsung Galaxy S22 Ultra running Android 13
  • How did you download the plugin: Package Manager downloaded from the Asset Store

Additional info

Otherwise it works great!!

This bug makes me concerned that people who want to be asked every time for the camera when the app starts will run into problems where the app stops working for them, either because they accidentally denied the permission one time or when the Android OS eventually revokes the permission automatically because the app wasn't used in a while

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions