Friday, December 2, 2022
HomeiOS Developmentios - The right way to save a picture url in Firebase...

ios – The right way to save a picture url in Firebase firestore

I’m attempting to avoid wasting the profileimageurl inside firebase Firestore but it surely reveals up empty contained in the debugger there isn’t any url hooked up.
How do I create a string to get my picture url to be saved in firestore

var ref: DocumentReference? = nil

let db = Firestore.firestore()
ref = db.assortment("customers").addDocument(knowledge: [
    "uid": AuthData.user.uid,
    "username": self.UsernameTextField.text!,
    "ProfileImageUrl": "" ,
]) { err in
    if let err = err {
        print("Error including doc: (err)")
    } else {
        print("Doc added with ID: (ref!.documentID)")
db.assortment("customers").getDocuments() { (querySnapshot, err) in
    if let err = err {
        print("Error getting paperwork: (err)")
    } else {
        for doc in querySnapshot!.paperwork {
            print("(doc.documentID) => (doc.knowledge())")



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments