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

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

Open
pankaj1920 opened this issue Sep 6, 2024 · 1 comment
Open

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

pankaj1920 opened this issue Sep 6, 2024 · 1 comment
Labels
question Further information is requested

Comments

@pankaj1920
Copy link

    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.

@MohamedRejeb
Copy link
Owner

Hi,
Sorry for the late reply, you can open app settings using: cameraPermission.openAppSettings()

@MohamedRejeb MohamedRejeb added the question Further information is requested label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants