Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionCallback called permissionGranted but it isn't #25

Open
Vadim-Smirnov opened this issue Sep 27, 2021 · 1 comment
Open

PermissionCallback called permissionGranted but it isn't #25

Vadim-Smirnov opened this issue Sep 27, 2021 · 1 comment
Labels

Comments

@Vadim-Smirnov
Copy link

When you ask a permission, android shows a popup, if at this moment app go to background and than back to foreground
PermissionCallback will trigger permissionsGranted but actually not. It happens because at this moment will call onRequestPermissionsResult with empty grantResults.

How we can see, method verifyPermissions return true by default, and how result wrong trigger of permissionGranted.
I think this method should return false by default.

fun verifyPermissions(grantResults: IntArray): Boolean {
    for (result in grantResults) {
      if (result != PackageManager.PERMISSION_GRANTED) {
        return false
      }
    }
    return true
  }
@tajchert
Copy link
Owner

Hi, I just tested this (Android 13) and I cannot recreate this scenario.
Once test app goes to background - Activity.onRequestPermissionsResult() is called, and inside Nammu.onRequestPermissionsResult() this permission is marked as refused.

Please retest and maybe provide if you can an additional info for me to recreate the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants