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