I just started to use Firebase/Storage
and I have the following question.
First here is the situation:
I have an image called myImage.gif that I uploaded to Firebase/Storage
. It all works fine.
I get a download URL for recovering the file at a later time.
For reference this is how I get the downloadURL:
......
imageRef.downloadURL(completion: {
(url: URL?, error: Error?) in
if (error == nil) {
if let downloadUrl = url {
// Get the download URL.
let downloadURL = downloadUrl.absoluteString
print("This is the downloadURL: \(downloadURL)")
}
} else {
print("Error:\n\(error!)")
}
});
The URL for downloading looks like this:
https://firebasestorage.googleapis.com/.../CollectionName%2myImage.gif?alt=media&token=abc12d34-2ex1-4xyz-5re4-c6d8ggqde765
And if I use it I can indeed download the file.
Now here is the question:
Being able to download the file is all right, but this is not exactly what I am interested in. I want a URL that I can use in a web page to bring the image to the view of the user, in other words to use like this:
<img src="theURL" alt="My wonderful image!">
How can I get such a URL? (instead of one for downloading)