UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Retrieve all images from firebase storage

Forums > Swift

In my app I will use images from firebase to create custom annotation views and I need all the photos which are stored in the storage.

Here is the code that I use to save images to firebase firestore and firebase storage

let imageTime = NSUUID().uuidString

        storage.child("pins/\(imageTime)").putData(imageData, metadata: metaData) { (meta, error) in
            if let err = error {
                print(err.localizedDescription)
            } else {
                storage.child("pins/\(imageTime)").downloadURL { (url, err) in
                    if let e = err {
                        print(e.localizedDescription)
                    } else {
                        let urlString = url?.absoluteString
                        doc.setData(["uid": uid, "pinLocation": lecoPin, "time": timeData, "url": urlString!]) { (error) in
                            if error != nil {
                                print(error?.localizedDescription)
                                return
                            } else {
                                print("Saved")
                            }
                        }
                    }
                }
            }
             print("Image sent")
        }

So how can I retrieve all saved images from database and use it in the future? I would highly appreciate any help)

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.