val cameraPermissionState = rememberMultiplePermissionsState(
permissions = listOf(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO),
)
LaunchedEffect(cameraPermissionState) {
if (!cameraPermissionState.permissionRequested) {
cameraPermissionState.launchMultiplePermissionRequest()
}
// The below is a just a lambda callback to the parent, so it can e.g. open the camera on permission granted
onPermissionsUpdated(cameraPermissionState)
}
Chris Fillmore
04/19/2022, 7:12 PM
But looking at
internal class MutableMultiplePermissionsState
, I don’t think I should be using this as a
key
, since it doesn’t override
equals()
(correct me if this reasoning is wrong)
Chris Fillmore
04/19/2022, 7:14 PM
Should I be key-ing specific effects on the properties of
MultiplePermissionsState
instead?
Chris Fillmore
04/19/2022, 7:15 PM
I had hoped to just pass MultiplePermissionsState back on to the parent directly on any change