I am trying to download all images uploaded in my Firebase Storage to UICollection View in Swift and displaying it to the user. The backend code to upload images to Firebase Storage is in Python. Currently, there is no way Firebase Storage supports multiple downloads unless the metadata(image Url's) are stored in a Real-time database. Most of the solutions implement it using a complete web-based/Android/iOS approach where the image upload and download logic are on the same platform. The architecture for these solutions is a Cloud Storage linked with Firebase Database that stores the image URLs.
How do I generate the image URLs for the uploaded images in Python and then access them using Swift?
The Python code that uploads the image to Storage is as follows:
# Import gcloud
from firebase import firebase
import firebase_admin
import google.cloud
from google.cloud import storage
from firebase import firebase
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/home/pi/Desktop/<sample.json>"
firebase = firebase.FirebaseApplication('<firebaseurl>')
client = storage.Client()
bucket = client.get_bucket('<bucketurl>')
imagePath = '/home/pi/Desktop/birdIMG.jpeg'
imageBlob = bucket.blob("/")
imageBlob.upload_from_filename(imagePath)