In the firebase, how to read the value of the "Created" metadata of users?

0

I want to get the date of creation of the user registration in the application, to compute a trial period. I thought about creating a cloud function to feed a variable with this value, which would be perfect for new cases, but it would not do anything for the almost 270 users in production. However, I saw that the panel already exists such a date and would like to get this data. How can I access this data?

    
asked by anonymous 12.09.2017 / 13:34

2 answers

1

You can capture this data using the firebase CLI with the command:

firebase auth:export account_file --format=file_format

where account_file is the name of the file where the data will be saved and file_format the file type, which can be either CSV or JSON. The results for JSON are something like this:

  {"users": [...
  {"localId": "key",
  "email": "[email protected]",
  "emailVerified": false,
  "passwordHash": "hash==",
  "salt": "salt==",
  "lastSignedInAt": "1504893158000",
  "createdAt": "1504558948000",
  "providerUserInfo": []
  }
  ...]}

Firebase auth

    
14.09.2017 / 20:53
0

You can use the Firebase Admin SDK to get the date. But you can not use it on android. I believe that for new users you do with metadata, and create a simple java program using the SDK and feed this database.

Just commenting, you can not use Android for two reasons:

  • If you add a SDK of this in an application to the general public, you'll empower them to manage your infrastructure.

  • The package names for both platforms are the same, and you would have conflicts on android.

  • The Admin SDK also has a version for node.js, so I think I can use it in cloud functions too (correct me if I'm wrong)

        
    12.09.2017 / 13:47