Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Created date and last login date from FIRUser with Firebase 3

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

enter image description here

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 ?

like image 546
iOSGeek Avatar asked Jul 03 '16 20:07

iOSGeek


1 Answers

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

like image 74
bojeil Avatar answered Sep 21 '22 13:09

bojeil