ios – Methods to add information to firebase database

[ad_1]

I’m attempting so as to add my consumer information into firebase database however I am receiving this error

Argument handed to name that takes no arguments

let consumer = Consumer(username: username)

How do I correctly construction this code to add my new consumer information into firebase database

var ref: DatabaseReference!
               let dbRef = Database.database().reference()
               
            let userID = Auth.auth().currentUser?.uid
            ref.little one("customers").little one(userID!).observeSingleEvent(of: .worth, with: { snapshot in
            let worth = snapshot.worth as? NSDictionary
              let username = worth?["username"] as? String ?? ""
                 let consumer = Consumer(username: username)

              // ...
            }) { error in
              print(error.localizedDescription)
            }

[ad_2]

Leave a Reply