Cloud Storage getDownloadURL()

Viewed 105

I am trying to retrieve downloadable URL of images in my Firestore database. This is my code:

var storageRef = firebase.storage().ref();
storageRef
  .child(`tutorials/images/${filename}`)
  .getDownloadURL()
  .then(function(url) {
    this.setState({ imgURL: url });
    console.log(url);
  })
  .catch(function(error) {
    console.warn(error);
  });

but I get a error RNFIrebaseStoragepromiseRejectStorageException error. Anyone have a solution to how I can successfully retrieve the downloadable URL from the Firestore? Thanks.

1 Answers

Things to try:

  1. Try to download a hardcoded URL, just to be sure the path exists
  2. Double check your storage permissions.
Related