Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
Not receiving push notifications on desktop browsers

I was using push notifications on my site just fine until recently, they stopped working. I'm using kreait/firebase-php to send the notifications and there are no errors there.

My service worker has this code to handle them

self.addEventListener('push', function(event) {
  //handle background push notifications
  console.log(event);
  const notif = event.data.json();
  console.log(notif);
  const options = {
    body: notif.notification.body,
    icon: notif.notification.icon,
    tag: notif.fcmMessageId,
    data: notif.notification.click_action
  };
  event.waitUntil(self.registration.showNotification(notif.notification.title, options));
});

When I send a test message from Chrome devtools > Applications > Service Worker, the first console.log appears, then there is this error: Uncaught SyntaxError: Unexpected token T in JSON at position 0. I'm not getting notifications on firefox either but I am receiving them on Chrome Android. I'm sending them to all 3 of these devices simultaneously.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda