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

142
Visualizações
Web Push notification payload ist null when sending ArrayBuffer

I am trying to send binary data from a Node.js server to a JavaScript service worker using the Web Push API.

On the Node.js side I use the web-push library and send the message with

webpush.sendNotification(subscription, buffer)

I get a status 201 and I receive the push message on the browser side. When I look at the Push Messaging log in the DevTools, I can even see the binary payload (encoded as UTF-8), and it says that the message was encrypted.

But when I try to get the ArrayBuffer in the service worker like this, event.data is null:

self.addEventListener('push', function (event) {
    console.log(event.data);
})

I don't understand how the data can be null if it was received by the client side.

about 4 years ago · Juan Pablo Isaza
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