How Can I Update the user Information in firebase! For Example, his email, password, and name, etc.
What firebase function would I use?
How Can I Update the user Information in firebase! For Example, his email, password, and name, etc.
What firebase function would I use?
That's a pretty vague question with numerous answers but here's the basics.
Assume you have a Firebase structure like this
users
uid_0
user_name: "Bill"
email: "bill@yipee.com"
To change the user name from Bill to Leeeeroy:
var userNameRef = ref.childByAppendingPath("users/uid_0/user_name")
userNameRef.setValue("Leeeeroy")
The above is a small example. You should investigate using .updateChildValues as well.
The Firebase website has a really good guide on writing data, check it out!
Saving Data
If you are looking into modifying the actual Firebase user data, instead of a users node you have created, look into
- (void)changeEmailForUser:(NSString *)email password:(NSString *)password toNewEmail:(NSString *)newEmail withCompletionBlock:(void ( ^ ) ( NSError *error ))block
here's the simple swift code to change the users Firebase email
myRootRef.changeEmailForUser("bob@thing.com", password: "old_password", toNewEmail: "new_password") { (<#NSError!#>) -> Void in
print("done!")
}