Open nihp opened 5 years ago
@nihp I also ran into this scenario. To add to this issue the image picker is slow in iOS which would most likely prompt the user to tap on buttons more than once.
@jqn Did you have any solution for this? If I add an alert inside while launching library it works fine.
@jqn I got a solution for the above
I have used both the library in a screen as below. Here after launching the library I have use crop window. Just works fine.
import ImagePicker from 'react-native-image-picker';
import ImageCropPicker from 'react-native-image-crop-picker';
ImagePicker.launchImageLibrary(options, (response) => {
if (response.didCancel) {
console.warn('User cancelled photo picker');
}
else if (response.error) {
console.warn('ImagePicker Error: ', response.error);
}
else {
ImageCropPicker.openCropper({
path: response,
width: deviceWidth,
height: deviceWidth*5/4
}).then(image => {
this.props.navigation.navigate('ShowAllCroppedImage', {uri: response.uri, croppedImage: this.croppedImage.bind(this)});
})
.catch((err) => {
console.log("openCropper error = " + err)
});
}
@nihp thanks I haven't had a chance to look into but I'll give your fix a shot.
I am getting illegal callback error while click on the choose. Here so I need to click choose two times.
Version react-native-image-crop-picker v0.22.0 react-native v0.58.4
Platform iOS
Expected behaviour Need to crop an image on the first click on the choose
Actual behaviour Illegal callback invocation from native module. This callback type only permists a single invocation from native code.
Steps to reproduce
Call ImagePicker.launchImageLibrary(react-native-image-picker....)
In the photo gallery, select a photo
Navigate to Crop window(react-native-image-crop-picker)
Click choose and again click on choose(Here need to click the choose twice)
And shows Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
Attachments