react-native-image-picker: Callback doesn't return anything [🐛]
Description
I’ll have launchImageLibrary and launchCamera running and they open the photo picker or the camera, but once I select the photo and return to the application the callback doesn’t run.
code calling image picker
uploadPicture = () => {
console.log("uploadPicture running");
launchImageLibrary(
{
mediaType: 'photo',
includeBase64: true,
},
(response) => {
console.log(response, "image picker response");
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.errorCode) {
console.log('ImagePicker Error: ', response.errorMessage);
} else {
console.log("image Picker worked!")
}
}
);
}
Solution
What needs to be done to address this issue?
Additional Information
Additional Information Image Picker version: [“react-native-image-picker”: “^3.3.2”] React Native version: [“react-native”: “0.63.4”,] Platform: [Android]
Android Logs
2021-03-18 12:01:01.092 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: ViewPostIme pointer 0
2021-03-18 12:01:01.195 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: ViewPostIme pointer 1
2021-03-18 12:01:01.208 13495-13873/com.app.test I/ReactNativeJS: uploadPicture running
2021-03-18 12:01:01.262 13495-13495/com.app.test D/SensorManager: unregisterListener ::
2021-03-18 12:01:01.278 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0
2021-03-18 12:01:03.233 13495-13873/com.app.test I/ReactNativeJNI: Memory warning (pressure level: TRIM_MEMORY_UI_HIDDEN) received by JS VM, ignoring because it's non-severe
2021-03-18 12:01:03.248 13495-13729/com.app.test D/OpenGLRenderer: eglDestroySurface = 0x7e4fb9eca0
2021-03-18 12:01:03.254 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true
2021-03-18 12:01:03.377 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=false 0} changed=false
2021-03-18 12:01:07.721 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=false 0} changed=false
2021-03-18 12:01:07.737 13495-13495/com.app.test D/SensorManager: registerListener :: 1, LSM6DSL Accelerometer, 66667, 0,
2021-03-18 12:01:07.759 13495-13495/com.app.test V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
2021-03-18 12:01:07.759 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 542774386688} changed=true
2021-03-18 12:01:07.768 13495-13729/com.app.test D/OpenGLRenderer: eglCreateWindowSurface = 0x7e4fb9eca0
2021-03-18 12:01:07.809 13495-13495/com.app.test D/ViewRootImpl@b4ddbcb[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2021-03-18 12:01:07.824 13495-13495/com.app.test V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@22c0f42 nm : com.app.test ic=null
2021-03-18 12:01:07.824 13495-13495/com.app.test I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 6
- Comments: 17 (3 by maintainers)
Hey - having the same problem. Using m1 also
Just use react-native-crop-image-picker. Better solution anyways. https://github.com/ivpusic/react-native-image-crop-picker
Strange there is no issues in the latest version I check. If possible can you check with the same code in iOS and see if callback is called? BTW there is not customButton option in latest version, check the docs carefully.
Are you updating from 2.xx or 1.x.x?
Ughhh so this is M1 issues. Think we can resolve this soon?
Same. Using M1 and callback didn’t return anything 😤😐