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

onPermissionsResult isn't triggered on POST_NOTIFICATIONS permission request (API 33). #1740

Open
lupsyn opened this issue Jan 18, 2024 · 2 comments

Comments

@lupsyn
Copy link

lupsyn commented Jan 18, 2024

Describe the bug

onPermissionsResult call back isn't triggered on android.permission.POST_NOTIFICATIONS on allow/deny (API 33)

To Reproduce

Use a generic impl as the following one to trigger the permission request.

fun UiContent.toPermissionDialog(
    rationale: @Composable () -> Unit = { },
    onPermissionResultCallback: (allPermissionsGranted: Boolean) -> Unit = {},
) {
    val permissionState = rememberMultiplePermissionsState(
        permissions = permissions,
        onPermissionsResult = { permissionGrantMap ->
        
            onPermissionResultCallback(permissionGrantMap.values.all { it })
        }
    )

    if (permissionState.allPermissionsGranted) {
        onPermissionResultCallback(true)
    } else {
        if (permissionState.shouldShowRationale) {
            rationale.invoke()
        }
    
        LaunchedEffect(key1 = this) {
            permissionState.launchMultiplePermissionRequest()
        }
    }
}

Expected behavior

onPermissionsResult should be triggered

Environment:

  • Android OS version: [API 33]
  • Device: [every device]
  • Accompanist version: [0.33.2-alpha]
Copy link

github-actions bot commented Mar 5, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Mar 5, 2024
@ianhanniballake ianhanniballake removed the stale Stale issues which are marked for closure label Mar 8, 2024
@chubecode
Copy link

how it's goin ?

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

No branches or pull requests

3 participants