I'm relatively new to Firebase and trying to develop an app which requires users to give their name and surname in sign up page. But firebase createUserWithEmail method only stores email and password. How can I add this name and surname data to my app and link them with the users? I suppose i need to use FIRStorage but in that way, only options to saving information is saving either from NSData or NSURL, how can I save my name and surname strings?
Thanks in advance!
Edit1: I suppose i was wrong, I need to use real time database rather than storage to save user data. But still I need help. I am coming from Parse and this seems complicated.
Swift is a powerful and intuitive programming language for macOS, iOS, watchOS, tvOS and beyond.
Swift is a powerful and intuitive programming language for macOS, iOS, watchOS and tvOS. Writing Swift code is interactive and fun, the syntax is concise yet expressive, and Swift includes modern features developers love. Swift code is safe by design, yet also produces software that runs lightning-fast.
Swift Code, BIC Code, ISO 9362. BIC sometimes also refers to “Bank Identifier Code”. Swift Code or BIC Code is a unique code to identify financial and non-financial institutions. These codes are mostly used when transferring money between banks, especially for international wire transfers or telegraphic transfer (“TT”).
Writing Swift code is interactive and fun, the syntax is concise yet expressive, and Swift includes modern features developers love. Swift code is safe by design, yet also produces software that runs lightning-fast.
Yes, you need to use the realtime database to store your user data. So after creating it you can call the setValue()
.
FIRAuth.auth()!.createUserWithEmail(email, password: pwd, completion: { authData, error in
if error == nil {
let userData = ["name": name,
"surname ": surname]
let ref = FIRDatabase.database().reference()
ref.child('users').child(authData!.uid).setValue(userData)
} else {
// handle error
}
})
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