use granular permission of for media perm request (#4609)
parent
77a512ae32
commit
873d91d466
|
@ -20,7 +20,9 @@ const openPermissionAlert = (perm: string) => {
|
|||
}
|
||||
|
||||
export function usePhotoLibraryPermission() {
|
||||
const [res, requestPermission] = MediaLibrary.usePermissions()
|
||||
const [res, requestPermission] = MediaLibrary.usePermissions({
|
||||
granularPermissions: ['photo'],
|
||||
})
|
||||
const requestPhotoAccessIfNeeded = async () => {
|
||||
// On the, we use <input type="file"> to produce a filepicker
|
||||
// This does not need any permission granting.
|
||||
|
|
|
@ -24,7 +24,7 @@ export function OpenCameraBtn({gallery, disabled}: Props) {
|
|||
const {_} = useLingui()
|
||||
const {requestCameraAccessIfNeeded} = useCameraPermission()
|
||||
const [mediaPermissionRes, requestMediaPermission] =
|
||||
MediaLibrary.usePermissions()
|
||||
MediaLibrary.usePermissions({granularPermissions: ['photo']})
|
||||
const t = useTheme()
|
||||
|
||||
const onPressTakePicture = useCallback(async () => {
|
||||
|
|
|
@ -59,7 +59,9 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) {
|
|||
const {_} = useLingui()
|
||||
const {activeLightbox} = useLightbox()
|
||||
const [isAltExpanded, setAltExpanded] = React.useState(false)
|
||||
const [permissionResponse, requestPermission] = MediaLibrary.usePermissions()
|
||||
const [permissionResponse, requestPermission] = MediaLibrary.usePermissions({
|
||||
granularPermissions: ['photo'],
|
||||
})
|
||||
|
||||
const saveImageToAlbumWithToasts = React.useCallback(
|
||||
async (uri: string) => {
|
||||
|
|
Loading…
Reference in New Issue