I appreciate any assistance that the community can offer! I have a React-native class component with the getPathForFirebaseStorage method that is called by a different method. However whenever the below method is called it returns :
{"_U": 0, "_V": 0, "_W": null, "_X": null}
where as the console.log from getPathForFirebaseStorage returns the actual local device path as is needed:
/storage/emulated/0/DCIM/Camera/IMG_20200726_091113.jpg
So any ideas on how I can improve getPathForFirebaseStorage so the return becomes accessible outside of its own local scope?? Here's the method:
getPathForFirebaseStorage = async (uri) => {
const stat = await RNFetchBlob.fs.stat(uri)
console.log(stat.path)
return stat.path
}
Here's the method where getPathForFirebaseStorage is being called:
handleLibraryPhoto = () => {
const options = {
storageOptions: {
path: 'images',
}
}
ImagePicker.launchImageLibrary(options, (response) => {
if (response.didCancel) {
console.log('User cancelled image picker')
} else if (response.error) {
console.log('ImagePicker Error: ', response.error)
} else if (response.customButton) {
console.log('User tapped custom button: ', response.customButton)
} else {
const source = {uri: response.uri};
const androidPath = this.getPathForFirebaseStorage(source.uri);
this.setState({image: androidPath});
console.log(this.state.image);
}
})
}