What is the best approach to handle permissions requests?

19 Views Asked by At

I have implemented accompanist permission, but as far as I know it is deprecated. What is the best new approach? My actual code:

    val notificationPermissionState: PermissionState
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
        notificationPermissionState = rememberPermissionState(
            Manifest.permission.POST_NOTIFICATIONS
        )

[...]
onClick {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                        notificationPermissionState.launchPermissionRequest()
    }
                    }
0

There are 0 best solutions below