How to get active users list from firebase using Javascript?

Viewed 34

I am using firebase for one to one, one to many chat and I want to show green dot with user who are currently active and red dot with users who are de-active or not logged in firebase. is there any solution in js, I am using Firestore Database?

1 Answers

Since you are using Firestore, you need to follow the instructions for Building presence in Cloud Firestore.

As you will read in this documentation section, the Firebase Realtime Database has a native presence feature. Since you use Firestore, the solution is to use a Cloud Function to mirror the presence data from the RTDB into Cloud Firestore

Related