undefined is not an object(evaluating 'ImagePickerManager.showImagePicker')
See original GitHub issueI Imported it as > var ImagePicker = require(‘react-native-image-picker’); .
I am using it as follow-
call() { var options = { title: 'Select Avatar', customButtons: [ {name: 'fb', title: 'Choose Photo from Facebook'}, ], storageOptions: { skipBackup: true, path: 'images' } }; ImagePicker.showImagePicker(options, (response) => { if (response.didCancel) { } else if (response.error) { } else if (response.customButton) { } else { let source = { uri: response.uri }; // You can also display the image using data: // let source = { uri: 'data:image/jpeg;base64,' + response.data }; this.setState({ avatarSource: source }); } }); }
Additional Information
react-native-image-picker@0.26.7
Issue Analytics
- State:
- Created 6 years ago
- Comments:13
Top GitHub Comments
I met this problem before.you need to rebuild after linking. Just call react-native run-ios/android after calling react-native-link.Hope it help.