Hi,
I'm using this awesome package to get profile photo and get cropped image in a multilanguage app.
I want to show a message/alert to the user when error occured and I need to translate every error types returned by catch method when ImagePicker.openPicker is called.
Is it possible to have a complete list of error code(s)?
Both iOS and Android
Calling this method:
...
getAndCropImage = () => {
ImagePicker.openPicker({
width: 300,
height: 400,
cropping: true
}).then(image => {
console.log(image);
}).catch(err => console.log(err.code));
}
...
You can find your answer on this old closed issue:
https://github.com/ivpusic/react-native-image-crop-picker/issues/884#issuecomment-440379335
check https://github.com/ivpusic/react-native-image-crop-picker/blob/master/ios/src/ImageCropPicker.m#L10, top of file, defines with ERROR prefixes
You should take the string after the at sign.
i.e
#define ERROR_PICKER_CANCEL_KEY @"E_PICKER_CANCELLED"
the err.code returns is E_PICKER_CANCELLED
Thank you so much @koo27 this is very helpful!
Most helpful comment
You can find your answer on this old closed issue:
https://github.com/ivpusic/react-native-image-crop-picker/issues/884#issuecomment-440379335
You should take the string after the at sign.
i.e
#define ERROR_PICKER_CANCEL_KEY @"E_PICKER_CANCELLED"the err.code returns is E_PICKER_CANCELLED