Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

young_artisan's avatar

Implementing Background Notifications in PWA with Laravel Echo and React

Hi everyone,

I’m looking for some help with listening to notifications in a PWA service worker, even when the page is closed. My backend is built with Laravel, and the frontend uses React with Vite PWA, Laravel Echo, and Laravel Reverb.

Currently, I can push notifications to the app and display them when the page is open. However, when the page is closed, the notifications don’t work. I believe this is because I’m handling notifications in a React component instead of the service worker.

Can someone guide me on how to properly implement notifications in the service worker so they work even when the page is closed?

Thanks in advance!

0 likes
0 replies

Please or to participate in this conversation.