I just want to get the created date and the last sign in date of a user with firebase, my plan is to let user login with Facebook and then signup and add new information and save the user in the real time database with the created date and last login date, so how to keep the date un sync with the Firebase system after saving them, or should I just use those f FIRUser and do not save them in the real time database
Question 1: how to get the created and last login date from FIRUser like displayed in the dashboard (see attached image)
Question 2: Once I get those dates I will save them in realtime database, so how to keep the last sign in date in sync ?
You can, starting with version 4.4.0, get the last sign in time and creation time in iOS from the currentUser: https://firebase.google.com/support/release-notes/ios#4.4.0
Auth.auth().currentUser.metadata.lastSignInDate
Auth.auth().currentUser.metadata.creationDate
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