Hi everyone! So we’re building a media app with a huge emphasis on community and would like for logged in users to be able to see a list of other currently logged in users and it would be GREAT if we could show users on the same page…think Peleton app showing users that are currently participating in a specific workout or have completed it previously. Concept is also similar to a “watch party” so you know who’s in the session with you.
Created a horizontal avitar list but not sure how to filter to only currently logged in users. Is this possible using read statuses or something along those lines?
You can add a True/false property in Users collection and when a user login in your app add run a action for update the user collection and change the true/false property to TRUE.
Now you can make a list and use filter for show just the users whit the property True/false be true.
Remember add a new update of the Users collection for change TRUE per FALSE when the user logout in your app.
The above shows if they have ever logged in (without logging out".
“Currently” logged in is going to be tricker.
As I don’t believe Adalo has a “do every x seconds” actions then what I would suggest is adding a field on the user for “last action time” and update that on every button click/page transfer.
Then you can filter your list where “last action” is withing the last x minutes. So users who have used your app in the last 10 minutes for example.
One work around for this is to have a record (Active) that gets updated with “date/time” every time the user interacts with the app (new screen/clicks a button).
Then make a list of all users that have been “Active” within the past 5 minutes (or whatever time range you want).