[Vuejs]-Vue Firebase cannot not fetch image url after uploading image

0👍

getDownloadURL() returns a promise, not a string. You need to use the promise to get the URL asynchronously, as shown in the documentation.

...
    .then(fileData => {
      return fileData.ref.getDownloadURL();
    })
    .then(imageUrl => {
      return firebaseApp
        .database()
        .ref("meetups")
        .child(key)
        .update({ imageUrl: imageUrl });
    })
...

Leave a comment