Calf icon indicating copy to clipboard operation
Calf copied to clipboard

How to navigate to app setting on Permission denied 2 times

Open pankaj1920 opened this issue 5 months ago • 0 comments

    val cameraPermission = rememberPermissionState(Permission.Camera) {isPermissionGranted->
    if (isPermissionGranted) cameraManager.launch()
}

ImagePickerBottomSheet(
    sheetState = sheetState,
    onDismiss = {
        coroutineScope.launch { sheetState.hide() }
    },
    onCameraClick = {
        Print.log("cameraPermission.status ${cameraPermission.status}")
        if (cameraPermission.status.isGranted) {
            cameraManager.launch()
        } else if (cameraPermission.status.isDenied) {
            cameraPermission.launchPermissionRequest()
        } 
        showImagePickerDialog = false

    },
    onGalleryClick = {
        singleImagePicker.launch()
        showImagePickerDialog = false
    }) 

Step => First time app open and click onCameraClick i got log, permission status isDenied "Print : cameraPermission.status Denied(shouldShowRationale=false)" then permission popup open and i click "Don't Allow" in Permission Dialog. then again i click on onCameraClick i Got log "cameraPermission.status Denied(shouldShowRationale=true)" and permission dialog is open and again i clicked on "Don't Allow". And again i click on camera in this case i need to go to camera setting in log i got "Print : cameraPermission.status Denied(shouldShowRationale=false)" .

How we will get to know we need to send to app setting becauser permission is denied 2 time.

pankaj1920 avatar Sep 06 '24 11:09 pankaj1920