user

Rakshit

27 Feb 2022

How chat mechanism works? when user comes online, How can I show green dot for that user?

Angular

The requirement is about adding chat functionality in my freelancing Angular project, 

Scenario:

How do I create a logic to detect when the user opened the website and logs in to the dashboard?

Once the user is accessing pages on the website, Can I detect him online somehow? How do I show the green icon (saying, the user is online right now)?

When user logs off or directly closes the window, it should say the user was online before X minutes, where X will be the number of minutes or hours.

My trial & error efforts:

I checked is-online package from npm. But it is not working as expected. When the user directly closes the browser, it still shows that the user is online, even after 5-10 minutes! which is not detecting the state of the user (Active or Inactive) accurately.

Can someone guide me on how do I create such logic?

 

Update 21-FEB-2023 : 

Found solution here: Medium

Comments

No Comments to show

© 2024 Copyrights reserved for web-brackets.com