As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I want to indicate to users how many other users are on a document, and so I need a way of knowing "when a user leaves the page".
[This blog post](https://www.firebase.com/blog/2013-06-17-howto-build-a-presence-system.html "This blog post") explains how firebase does it - does kinvey have similar functionality?
Not out of the box, but this is something that can be easily implemented. Right after your `Kinvey.init` call, set `Kinvey.getActiveUser().lastOnline = new Date();`, and call save on the active user.
Now that all users have a `lastOnline` property, you can query the user collection for users online right now. Depending on your use case, you can adjust the time query to whatever works for you. The query would be similar to:
```
var threshold = new Date().getTime() - 5 * 60 * 1000;// Users online in the last 5 minutes.
var query = Kinvey.Query().greaterThan('lastOnline', new Date(threshold).toISOString());
```
The result of the query will list all users online in the last five minutes.
j
jaredforsyth
said
over 9 years ago
Hmm I was hoping for something a little more real-time than that -- my use case is multiple people editing a document (google docs style)
M
Mark
said
over 9 years ago
In that case, I am assuming you are sending a request to Kinvey every time the document is updated (i.e. the user makes a change)? You could use a collection hook to update the `lastOnline` time right then, that will give you a more precise estimate. That’s the closest to real time I can think of.
R
Ryan
said
over 9 years ago
The last option is to use polling, hit a custom endpoint that just updates the `lastOnline` status every 10 seconds or something. You could even have that endpoint return who is online within the last 20 seconds or something like that.
As of today there is no way to get push status changes on user activity ala websockets with Kinvey. You are either going to have to poll or use push notifications (if on mobile).
jaredforsyth
[This blog post](https://www.firebase.com/blog/2013-06-17-howto-build-a-presence-system.html "This blog post") explains how firebase does it - does kinvey have similar functionality?