Skip to content

Commit

Permalink
Fixed : Runtime location permission system dialog not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
umer0586 committed Oct 21, 2024
1 parent a32058a commit dd04f4c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private fun SensorScreenContent(
onGPSCheckedChange = { checked ->
locationPermissionState?.let { permissionState ->
if(checked){

if(permissionState.status.isGranted)
onUiEvent(SensorScreenEvent.OnGPSCheckedChange(checked))
// If the user has denied the permission previously
Expand All @@ -126,9 +127,11 @@ private fun SensorScreenContent(
else if (permissionState.status.shouldShowRationale)
permissionState.launchPermissionRequest()
// Permission has been denied permanently
else
else if (!permissionState.status.isGranted)
showPermissionAlert = true

permissionState.launchPermissionRequest()

}else{
onUiEvent(SensorScreenEvent.OnGPSCheckedChange(checked))
}
Expand Down

0 comments on commit dd04f4c

Please sign in to comment.