I m building an app using the react native with expo in which i need the permission for the image gallery on android

859 Views Asked by At

As i mentioned above i m unable to get permissions for image gallery as according to the error i m getting it says CAMERA_ROLL is deprecated. I searched whole documentation regarding the same at react native website ass well as on expo documentation but i can't find anything helpful from those so it would be a big help if u can provide me the solutions. Also this is my first time here...sorry if the format is bad I have entered the screenshot of the code as you can see CAMERA_ROLL is strikethrough

1

There are 1 best solutions below

5
Eloi On

Use ImagePicker.getCameraPermissionsAsync() and ImagePicker.launchCameraAsync() for the camera

ImagePicker.requestMediaLibraryPermissionsAsync() and ImagePicker.launchImageLibraryAsync() for the gallery

Check the documentation here for other options: https://docs.expo.io/versions/latest/sdk/imagepicker/