How to update user using displayName

Therefore, I use FIRAuth createUserWithEmailto create a new user. I also want to assign displayNamefor this user. But this function only accepts email and password. What do I need to insert displayName?

FIRAuth.auth()?.createUserWithEmail(email, password: password, completion: { (user: FIRUser?, error: NSError?) in


})

Edit: Thus, there is a function called updateProfile. But this does not look like the iOS platform library. Any idea?

Edit: solution found here : need to use functionprofileChangeRequest

+4
source share
2 answers

Firebase, FIRAuth.auth().currentUser.profileChangeRequest, , . , . updateEmail updatepassword

+1

let changeRequest = Auth.auth().currentUser?.createProfileChangeRequest()
changeRequest?.displayName = displayName
changeRequest?.commitChanges { (error) in
  // ...
}
+1

Source: https://habr.com/ru/post/1648520/


All Articles