i am using create-react-native-app
and i am having a problem with permissions in trying to get an image from the camera roll.
when i call the method: ImagePicker.launchImageLibraryAsync
, i get the error: Missing camera roll permission.
import { ImagePicker } from 'expo';
export const getImageFromLibrary = () => ({
type: GET_IMAGE_FROM_LIBRARY,
promise: () => ImagePicker.launchImageLibraryAsync({
height: '100px',
width: '100px',
base64: true
})
});
the error: Missing camera roll permission.
suggests that my app does not have permission, so i then created another button to request permission.
import { Permissions } from 'expo';
<Button
onPress={() =>
Permissions.getAsync(Permissions.CAMERA_ROLL)
.then(console.log)
}
><Text>get permission</Text></Button>
but when i click on this button i the console.log()
method returns with: {status: "granted", expires: "never"}
.
this would mean the permission is granted without ever expiring. but the call to get an image from the library is still denied for not having permission.