Quick-Chat icon indicating copy to clipboard operation
Quick-Chat copied to clipboard

Update Users Profile Icon and name

Open andrewga opened this issue 5 years ago • 2 comments

Is it possible to update the users profile Icon and username?

andrewga avatar May 08 '19 02:05 andrewga

@andrewga I'm planning to add that feature in near future

aslanyanhaik avatar May 08 '19 06:05 aslanyanhaik

@andrewga & @aslanyanhaik , I have tried below code to update user profile icon & username and it works.

UPDATE

func updateUserDetail(strUpdateName: String, strProfileURL: String) {
        let ref = Firestore.firestore().collection("Users")
        ref.document(UserManager().currentUserID() ?? "").updateData(["name": strUpdateName, "profilePicLink": strProfileURL]) { (err) in
            if let err = err {
                print("Error updating document: \(err)")
            } else {
                print("Document successfully updated")
            }
        }
    }

StellarKuldeep avatar Aug 28 '19 08:08 StellarKuldeep