Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda