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

185
Views
¿Cómo enviar una notificación de tema de firebase en node y express?

Quiero enviar una notificación a todos los usuarios de la aplicación, el desarrollador de Android suscribió el nombre del tema con ALL_USER pero no puedo enviar una notificación a ese tema.

Gracias por la ayuda de antemano.

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Prueba esto -

  1. Desde su proyecto de Firebase, descargue el archivo JSON que contiene la clave del servidor y colóquelo en la carpeta raíz privatekey.json.

  2. Use el siguiente código en su API o función.

 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!