Please provide the following:
- SDK Version: 36
- Platforms(iOS):
Howdy,
I have a component that uses CameraRoll.getPhotos(), using expo-permissions.
After upgrading to 36, CameraRoll isnt included in react-native anymore. When trying to use CameraRoll from @react-native-community/cameraroll, I get an error _nativeInterface.default.getPhotos is not defined.
According to their documentation, it appears you need to eject to avoid this error.
In Expo 35 I was able to getPhotos without having to eject.
Any help would be appreciated.
Heres my component:
export function AddMediaItem(props: AddMediaItemProps) {
// ...
useEffect(() => {
ensurePermissions()
.then(() => CameraRoll.getPhotos({
assetType: 'Photos',
first: 20,
groupTypes: 'All',
}));
}, [ ]);
const ensurePermissions = async () => {
if (Constants && Constants.platform && Constants.platform.ios) {
const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
if (status === 'granted') {
updateGrantedPermissions(true);
}
}
};
// ...
}