How to get downloadUrl after uploadString in firebase v9?

Viewed 265

There is no documentation on firebase docs as to how to get UploadTask after uploadString is done in firebase v9.

const message4 = 'data:text/plain;base64,5b6p5Y+344GX44G+44GX44Gf77yB44GK44KB44Gn44Go44GG77yB';
uploadString(storageRef, message4, 'data_url').then((snapshot) => {
  console.log('Uploaded a data_url string!');
});

or how can I get the downloadUrl after the uploadString is completed?

1 Answers

I got the answer.

uploadString(storageRef, uri, 'data_url').then((snapshot) => {
    getDownloadURL(snapshot.ref).then(async (url) => {
            // Url  
    })
})
Related