I am trying to implement web push notifications in my project, but none of the approaches I tried are working. I’m not sure whether the issue is on the frontend, backend, service worker, or the push provider configuration.
My Tech Stack
Frontend: React + Vite
Backend: Spring Boot (Java)
Database: MySQL (storing push subscriptions / device tokens)
What I Have Tried
I attempted multiple methods for sending push notifications:
WebSockets – real-time connection works, but notification is not shown in the browser when the tab is closed or inactive.
VAPID + Web Push API– subscribe
AWS SNS (Web Push Platform Application) – device registered, but SNS returns message-delivery failures.
Firebase cloud messaging – FCM token is generated, but no notification is received on the client.
Current Behavior
Service Worker registers successfully.
Push subscription is created and saved in SQL.
IN
Either I get a server error (400/500)
Or the request is successful but no notification appears in the browser.
What I Need Help With
What is the correct/best way to implement browser push notifications for:
React (Vite)
Java Spring Boot
Service Worker
Is there a working example or common mistakes to check?
Are there required headers, payload formats, or service-worker rules I might be missing?
Extra Notes
I’m testing on localhost + production domain (HTTPS).
It's going to happen.
Subscribe
-
3Please incldue the actual code you use for subscribing to push, the service worker hadnler, and the backend request you send. Also, add the full error respnses.Viktor Sbruev– Viktor Sbruev2025年11月22日 16:04:42 +00:00Commented yesterday
Explore related questions
See similar questions with these tags.