Last seen activity in real-time

Hi team,

On our 1-1 chat on our web app (JS), under the person’s name it lets them know if the person is online or offline (see below image). But it isn’t continuously updating in real-time. e.g Last seen 3 minutes ago, then after 1 minute, last see 4 minutes ago etc… Is there any API or logic we can use to continuously refresh and update the time in real-time? (similar to FB/whatsapp logic) @anant.garg @mayur.bhandari

Screen Shot 2021-03-16 at 5.58.24 pm

Also, we have noticed with the cometchat response that once a user logs out, they remain ‘online’ forever. E.g user logs out 3 weeks ago, but the cometchat response is saying that there still logged in. Developer cannot fix this, this is the response we are getting from cometchat…

@flipspot You will have to create a timer function to update the Last seen X minutes ago.

1 Like

how do we do this?

Also have you seen the question i wrote after:

“Also, we have noticed with the cometchat response that once a user logs out, they remain ‘online’ forever. E.g user logs out 3 weeks ago, but the cometchat response is saying that there still logged in. Developer cannot fix this, this is the response we are getting from cometchat…”

Thanks @anant.garg

Hello @flipspot,

After the user logs out in which API call.are you getting that the user is still logged-in. I have checked it on our end and everything seems to be working fine.

Can you please provide more details on this? Is this happening for any specific user or all user? Is this happening intermittently or all the time?

The user who is facing this issue is using your Web platform or Android/iOS app.

Warm Regards,

CometChat Pro
Mayur Bhandari

1 Like

@flipspot You’ll have to implement the timer function on your own. Sorry, we do not have any specific guidelines for it.

1 Like

We have implemented a timer but to refresh every single for mutiple chats is really hampering the efficiency and speed of the app. We want the logic like Facebook or whatsapp, every second the activity status is updating, while speed is fast.

Im sure cometchat has a solution for this as the module is fully customizable, can you please let us know how to do this, this is a fairly basic function for a chat app

1 Like

You can refer to similar questions in StackOverflow: java - SimpleDateFormat Clock Auto-Update - Stack Overflow

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.