Skip to main content

Function: useCameraPermission()

useCameraPermission(): PermissionState

Returns whether the user has granted permission to use the Camera, or not.

If the user doesn't grant Camera Permission, you cannot use the <Camera>.

Returns​

PermissionState

Example​

const { hasPermission, requestPermission } = useCameraPermission()

if (!hasPermission) {
return <PermissionScreen onPress={requestPermission} />
} else {
return <Camera ... />
}

Defined in​

hooks/useCameraPermission.ts:62