It's not straight forward though. different browsers implement this differently.
But you can do two things, use the offlineOnline browser api here
Ping a website you are sure will always be available such as Google in a http request. You can broadcast same event to other members saying the user is offline. That's it.
Would you not do presence by holding an array of users on server side and upon connection add the user to the array and broadcast to everyone/room...and on disconnect remove the user from the array and broadcast the disconnection status ?
Heya! Can you tell me how to add a feature for showing "online", once the user is active?
Great work!
It's not straight forward though. different browsers implement this differently.
But you can do two things, use the offlineOnline browser api here
Ping a website you are sure will always be available such as Google in a http request. You can broadcast same event to other members saying the user is offline. That's it.
Would you not do presence by holding an array of users on server side and upon connection add the user to the array and broadcast to everyone/room...and on disconnect remove the user from the array and broadcast the disconnection status ?
chat-with-friends.herokuapp.com/
Here's my chat application. Check it, please :)
Went through it. It seems to work really well. Good job.
Do you plan to make something much more bigger with this?
Glad to see what you have build so far. Keep it up.
Thank you! :) Yeah, I am looking for ideas to make something better out of it.