vendredi 18 décembre 2015

How To Send Notifications To A Specific User Group / Role Only using Socket.io?

I am working on a project which I want to implement a feature where after an action happens, I want to notify all online administrators on the web app and show them a message that an action happened.

I have a few questions:

  1. How can I identify which user is online and has an admin role? I am looking for some ideas around "show all online users" list

  2. Should I put these admins into a room where I can broadcast the notification only to that room?

  3. How can I get all users who are online and associate their socket ID with the ID / Username in the database?

I will also need the online status to be shown in a table so I can know if UserOne and John are online at the moment.

  1. How can I keep the online / offline status? Do I have to keep the status somewhere outside of the database?

I am using Laravel v5.1, NodeJS v5.0, Socket.io v1.3 and Redis to play around with the notifications.

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire