Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update user with displayName

So I use FIRAuth's createUserWithEmail to create new user. I also want to assign the displayName for this user. But this function only accept email and password. What do I go about to insert displayName?

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


})

Edit: So there seemed to be a function called updateProfile. But it does not seem to be available for the iOS platform library. Any idea?

Edit: Found solution here: Need to use profileChangeRequest function

like image 420
user523234 Avatar asked Jul 20 '16 13:07

user523234


People also ask

How do I change my Office 365 username?

Watch: Change a user's name or email addressIn the Microsoft 365 admin center, select Users > Active users. Select the user from the list of active users. Select Manage contact information. Change the display name, and select Save changes.

How to change display name using PowerShell?

How to change the SharePoint user display name with PowerShell? Well, You can use the Set-SPUser cmdlet. Just provide the account identity, site, and the new display name for the user. Run this PowerShell cmdlet from SharePoint Management Shell.

How do I change my Active Directory display name?

Start Microsoft Management Console (MMC), and then add the ADSI Edit snap-in. Right-click the top node, and then select Connect to. Change the Naming Context to Configuration Container, and then select OK to bind and authenticate.


2 Answers

Documentation is here

let changeRequest = Auth.auth().currentUser?.createProfileChangeRequest()
changeRequest?.displayName = displayName
changeRequest?.commitChanges { (error) in
  // ...
}
like image 63
DoesData Avatar answered Sep 20 '22 18:09

DoesData


When you want to change the details of a user in Firebase, you want to use FIRAuth.auth().currentUser.profileChangeRequestin order to update any details other than the user's email and password. To update their email or password, you need to use a specific method for each. updateEmail and updatepassword

like image 28
Dan Levy Avatar answered Sep 22 '22 18:09

Dan Levy