Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
how to send firebase topic notification in node and express?

I want to send notification all users in app, Android developer subscribed topic name with ALL_USER but I am not able to send notification to that topic.

Thanks for help in Advance.

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try this -

  1. From your firebase project download the JSON file which contains the server key and places it in the root folder privatekey.json.

  2. Use the below code in your API or function.

var fcm = require('fcm-notification');
var FCM = new fcm('./privatekey.json');

var message = {
    topic: topic,
    notification: {
      title: title,
      body: body
  }
  };

  FCM.send(message, function (err, response) {
    if (err) {
      console.log("Something has gone wrong!" + err);
    } else {
      console.log("Successfully sent with response: ", response);
    }
  });
almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!