Created
September 30, 2021 03:11
-
-
Save sproctor/86d037541e1eed950c34fdf2dcbeed7d to your computer and use it in GitHub Desktop.
Request permission
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val permissionState = | |
rememberPermissionState(permission = Manifest.permission.ACCESS_FINE_LOCATION) | |
PermissionRequired( | |
permissionState = permissionState, | |
permissionNotGrantedContent = { | |
LaunchedEffect(Unit) { | |
permissionState.launchPermissionRequest() | |
} | |
}, | |
permissionNotAvailableContent = { | |
Text("Access fine location permission denied") | |
} | |
) { | |
// Do barcode stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment