0

I was curious to know that can we implement push notification to our client via our Node.js server just like we send emails using nodemailler in Node.js? If yes! Then how? Can anyone please briefly elaborate. Also a point to note that the push notification should be user specific just like our mails are which are distinguished by our mail id.

Thanks in advance.

2 Answers 2

1

You can achieve this using Firebase Cloud Messaging. Here's a high level overview:

  1. Each client registers with FCM and sends it's unique token to your node.js server.
  2. The server saves this token and associates it with the user.
  3. When it comes time to send the push notification, you use the FCM node.js library to send a push notification to the token associated with the user you want.
0

Not sure if it is the best way.

You might open a port on server side and listen to that port from client side. I am talking about socket programming. New notifications will be sent through that open port.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.