2

I am working on a new project in which we have tiny social networking feature, where each user has an ability to post/share quotes, and more over facility of like and comment.

so, i want to build a (user specific )realtime push notification module with nodejs.

KrunalG
  • 67
  • 1
  • 9

3 Answers3

7

You can use socket to do so. What you can do is create a userList array on server who are online in the system. The userList will contain user information along with the socket id.

When a particular event occurs you know to whom to send that notification, and then check if all those users are available in the userList. If a user is available in the userList, use socket to emit the notification to that users.

Jeet
  • 717
  • 6
  • 18
1

I'm not sure what your question is exactly- or what specific problem you're trying to solve, but gave my thoughts on a similar question here.

See Server Sent Events.

Community
  • 1
  • 1
0

Yea. You can use Socket.io. In system , you can store the uses have connection to system. After you can check available users, if user available then you send (emit) to user with channel is socket.id.

anonystick
  • 362
  • 1
  • 9