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?
- “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:
Is there any update regarding ways of detecting user presence/online status.
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
trueeach 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 and
truethen the user is online
Thank you, This helpful.