Skip to content

How to navigate to app setting on Permission denied 2 times #175

@pankaj1920

Description

@pankaj1920
    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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions