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
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 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.
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.
Documentation is here
let changeRequest = Auth.auth().currentUser?.createProfileChangeRequest()
changeRequest?.displayName = displayName
changeRequest?.commitChanges { (error) in
// ...
}
When you want to change the details of a user in Firebase, you want to use FIRAuth.auth().currentUser.profileChangeRequest
in 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With