Skip to content

PermissionCallback called permissionGranted but it isn't #25

Description

@Vadim-Smirnov

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
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions