How to get the count of authentications in firebase console in the flutter app?

Viewed 28

How to get the count of Authentications in firebase console by using flutter for example: 1000 users are authenticated to my app. i can see the users who are authenticated to my application through firebase console.But I need to get the count of authentications (1000) in my flutter admin applications.

Now i'm getting the authentication count with the help of cloud firestore by simply create the collection and inside the document i'm incrementing the count of integer whenever the new user sign in.

Is there any way to do it without the help of cloud firestore.Kindly help me to solve this issue. Thanks in advance..

1 Answers

As Dharmaraj commented, you get get a list of all users from the Firebase Admin SDK. This SDK cannot be used directly in your Flutter app though, and is meant to be used only in trusted environments. I also don't think it's the best fit for your use-case, as listing all users is going to slow down as you add more users to your app.

Keeping a count of what you want to show in the database (as you already seem to be doing) is probably the right approach here, as it amortizes the cost of maintaining the counter over the user actions, makes the reads trivial, and allows you to track exactly the count of actions that fits with your use-case.

Related