yt-devmeetup-vue-firebase icon indicating copy to clipboard operation
yt-devmeetup-vue-firebase copied to clipboard

Firebase `downloadURLs` is deprecated

Open GregJacobs82 opened this issue 5 years ago • 5 comments

https://github.com/academind/yt-devmeetup-vue-firebase/blob/0f3ee16c83b2c4a23ef497a1ad0656cd0f92f921/src/store/index.js#L99

REFERENCE: https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL

GregJacobs82 avatar Feb 19 '20 05:02 GregJacobs82

FIX:

 imageUrl = fileData.ref.getDownloadURL().then((firebaseUrl) => {
    return firebase.database().ref('meetups').child(key).update({imageUrl: firebaseUrl})
})

GregJacobs82 avatar Feb 19 '20 05:02 GregJacobs82

I Need its latest version

skyccpbx avatar Sep 17 '20 10:09 skyccpbx

Errors upon "npm run dev"

skyccpbx avatar Sep 17 '20 10:09 skyccpbx

Not admitting that I have the best solution, but the code below worked for me after a few hours of trying

code:

      const filename = payload.image.name
      const ext = filename.slice(filename.lastIndexOf('.'))
      firebase.storage().ref('equipment/' + key + ext).put(payload.image)
        .then(() => {
          return firebase.storage().ref('equipment/' + key + ext).getDownloadURL()
            .then((url) => {
              firebase.database().ref('equipment').child(key).update({ imageUrl: url })
            })
        })
    })`

thematthewko114 avatar Feb 20 '21 15:02 thematthewko114

ignore the equipment ref if you are following max's example, I customised it for myself and you can change it back to meetup

thematthewko114 avatar Feb 20 '21 15:02 thematthewko114