rememberPermissionFlowRequestLauncher

Creates a ManagedActivityResultLauncher that is tied with PermissionFlow APIs and remembered across recompositions.

Example:

@Composable
fun DemoPermissionLaunch() {
val permissionLauncher = rememberPermissionFlowRequestLauncher()

Button(onClick = { permissionLauncher.launch(Manifest.permission.CAMERA) }) {
Text("Launch Camera Permission Request")
}
}

Make sure to use ManagedActivityResultLauncher.launch method inside callback or a side effect and not directly in the compose scope. Otherwise, it'll be invoked across recompositions.

Parameters

onResult

The callback to invoke when the result is received.