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

138
Views
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
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!