Much like how major instant-messaging apps show whether a user is online (or when were they last seen), is there any possible way to detect this online presence in Backendless?
Hi!
- “Last seen” value is shown in column “lastLogin” in users table.
- Currently we don’t have this functionality (but this task is already added to the roadmap).
You can add check for “is online/offline” with your client code or with Business Logic service: - For example, create table “onlineUsers” in data service. After user’s successful login you set value true/false in column “isOnline”. You can do it with your sdk methods or with event handler “afterLogin”. You can find more info about Business Logic service here:
https://backendless.com/documentation/business-logic/java/bl_overview.htm
Regards,
Kate.
Hello!
Is there any update regarding ways of detecting user presence/online status.
Thanks.
Hello @jaypee_peros
There is no built-in way to detect whether a user is online or not. But you can use the following algorithm:
- Use Backendless Cache to store the key
online:<user-id>
with valuetrue
each minute(or whatever you need) with expiration in 2 minutes. - To check if a user is online you just call Backendless Cache ‘get’ method for the key
online:<user-id>
and if the value not null andtrue
then the user is online
2 Likes