TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How to save lots of images to firebase storage and cloud firestore(with url)?

Forums > Swift

I'm struggling with how to get and save the image url of the pictures to database. I also need to know how to store images with unique names all the time so old images don't get deleted by new ones.

  let storage = Storage.storage().reference()
        guard  let imageData = ecoImage.jpegData(compressionQuality: 0.75) else {
            return
        }

        let metaData = StorageMetadata()
        metaData.contentType = "image/jpg"

            storage.child("pins/\(uid)").putData(imageData, metadata: metaData) { (StorageMetadata, error) in
            guard StorageMetadata != nil else{
                print("oops an error occured while data uploading")
                return
            }
                 print("Image sent")
            }

doc.setData(["uid": uid, "pinLocation": Pin, "time": timeData]) { (error) in
            if error != nil {
                print(error?.localizedDescription)
                return
            } else {
                print("Pin saved")
            }
        }

2      

I not sure about Firebase but this video might help #1 Grocery App - Setting Up Firebase with Xcode 12 and then there #2 as well.

2      

@BlackNoirImpost3 - Did you come up with a working resolution for this in the end?

2      

Hi, i have interpolated my data set. I would like to check which method will be best suited for my data. Reference data for cross validation is missing. Is any other method exit with which i can check which interpolation technique will be best suited for my data set?

2      

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

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.