Jason Tremain
Jason Tremain

Reputation: 1399

Write Firebase Auth User UID to database

Currently I have my app making user profiles and generating an autoID to my database using the following:

databaseRef.child("users").childByAutoId().setValue(user)

Instead of using .childByAutoID, I'd like that to be the User UID that's generated using the Firebase User UID value, however I'm not sure how to swap that into my code above.

Upvotes: 0

Views: 1273

Answers (1)

Dravidian
Dravidian

Reputation: 9945

databaseRef.child("users").child(FIRAuth.auth()!.currentUser!.uid).setValue(user)

Upvotes: 2

Related Questions