0
votes

I'm building a react native app with firebase storage and i'm trying to 1) store the image in storage, 2) retrieve downloadURL, 3) set the downloadURL string in firebase for access via the database

storage().ref('users').child(userKey + '/profileImage').put(image.path).then(() => {
    storage().ref('users').child(userKey + '/profileImage').getDownloadURL().then(image => {
        setProfileImage(image)
        firestore().collection('users').doc(userKey).set({
            profileImage: image
        }).catch((e) => console.log('uploading image error1 => ', e));
    }).catch((e) => console.log('uploading image error2 => ', e));
}).catch((e) => console.log('uploading image error3 => ', e));

I'm getting the following error at the first storage callenter image description here

1

1 Answers

0
votes

What value and type is your image.path variable. If you look at the documentation for Reference.put you can see that it accepts Blob | Uint8Array | ArrayBuffer and I somewhat doubt that image.path is one of those types.