In my React Native app, I use the react-native-image-crop-picker
package to have access to user's photo library.
It works nicely but if the user has no images in his/her photo library, I want to give the user a way to cancel out or exit it. How do I do that? Currently in Android, I click the element e.g. button or menu item to access user's photo library but then I get stuck there -- see image below:
And if I use gestures to get back to my app, I get the following warning.
Possible Unhandled Promise Rejection
My code is pretty basic at this point. When the user presses a button, I call this function which invokes the image picker:
pickImage() {
ImagePicker.openPicker({
width: 400,
height: 250,
cropping: true
}).then(image => {
onFilePicked(image);
});
}
Basically, I just need to give the user a way to cancel out of picking an image from the photo gallery. I'd appreciate some pointers on this. Thanks!