Bolt integration

Firebase Push Notifications Failing in Bolt App

Your Bolt.new application is set up with Firebase Cloud Messaging (FCM) for push notifications, but users never receive them. The notification permission prompt may not appear, tokens fail to generate, or notifications are sent from the backend but never arrive on users' devices.

Push notifications are essential for user re-engagement: notifying users about new messages, order updates, price alerts, or time-sensitive events. When they don't work, your app loses its ability to bring users back, and you have to rely entirely on email which has much lower engagement rates.

Firebase push notifications involve multiple moving parts: a service worker on the client, a valid FCM token per device, proper Firebase configuration, and a server-side component that sends the actual notifications. Bolt's AI typically sets up some of these pieces but misses critical configuration steps.

Error Messages You Might See

FirebaseError: Messaging: A problem occurred while subscribing the user to FCM Error: Service worker registration failed FirebaseError: Messaging: The notification permission was not granted messaging/token-subscribe-failed FirebaseError: Messaging: We are unable to register the default service worker 403 SenderId mismatch
FirebaseError: Messaging: A problem occurred while subscribing the user to FCMError: Service worker registration failedFirebaseError: Messaging: The notification permission was not grantedmessaging/token-subscribe-failedFirebaseError: Messaging: We are unable to register the default service worker403 SenderId mismatch

Common Causes

  • Service worker not registered — Firebase requires a firebase-messaging-sw.js service worker file in the public root directory, which Bolt may not have created
  • Firebase config mismatch — The Firebase configuration in the app doesn't match the project in Firebase Console, so FCM can't authenticate
  • Notification permission not requested — The app never calls Notification.requestPermission(), so the browser blocks all notifications
  • FCM token not saved — The device token is generated but never sent to your backend for storage, so you can't target the user for notifications
  • VAPID key missing — The Voluntary Application Server Identification (VAPID) key is not configured, which is required for web push
  • Browser or OS blocking notifications — The user or their OS has disabled notifications globally, and your app doesn't detect or communicate this

How to Fix It

  1. Create the service worker file — Add firebase-messaging-sw.js to your public folder: importScripts('https://www.gstatic.com/firebasejs/10.7.0/firebase-app-compat.js', 'https://www.gstatic.com/firebasejs/10.7.0/firebase-messaging-compat.js'); firebase.initializeApp({...config}); firebase.messaging();
  2. Request permission properly — Ask for notification permission with context: show a UI explaining why notifications are useful before calling Notification.requestPermission()
  3. Generate and save FCM token — After permission is granted: const token = await getToken(messaging, { vapidKey: process.env.NEXT_PUBLIC_FIREBASE_VAPID_KEY }); await saveTokenToBackend(token, userId);
  4. Configure VAPID key — In Firebase Console > Project Settings > Cloud Messaging, generate a Web Push certificate key pair and use the public key as your VAPID key
  5. Send from backend with Admin SDK — Use Firebase Admin SDK on the server: admin.messaging().send({ token: userFcmToken, notification: { title: 'New message', body: 'You have a new message' } })
  6. Handle token refresh — FCM tokens expire and refresh. Listen for token changes: onMessage(messaging, (payload) => handleForegroundMessage(payload))

Real developers can help you.

BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. PawelPloszaj PawelPloszaj I'm fronted developer with 10+ years of experience with big projects. I have small backend background too Jacek Rozanski Jacek Rozanski Senior PHP/Symfony developer and DevOps engineer with 20+ years of professional experience, running opcode.pl (web development agency, est. 2004). Day job: I'm the sole backend developer at merketing company where I own and maintain 11 PHP/Symfony microservices on AWS (ECS Fargate, RDS, S3, CloudFront), handle the full CI/CD pipeline (Bitbucket Pipelines, Docker), and manage monitoring with Sentry and CloudWatch. These services handle high request volumes in production every month. What I bring to AI-built apps: - I audit and fix security issues (OWASP methodology), performance bottlenecks, and architectural problems in codebases generated by Cursor, Claude Code, Lovable, Bolt, and v0 - I refactor AI-generated prototypes into production-grade applications with proper error handling, testing, and clean architecture (SOLID, DDD, hexagonal architecture) - I set up the infrastructure AI tools don't touch: AWS hosting, CI/CD pipelines, automated deployments, database optimization, monitoring, and alerting - I integrate external services: payment providers, email systems, partner APIs, SSO/auth Tech stack: PHP 8.x, Symfony, React, Next.js, PostgreSQL, MySQL, Docker, AWS (ECS, RDS, S3, SQS/SNS, CloudFront), Terraform, Supabase. I also use AI tools daily (Claude Code, Cursor) in my own workflow, so I understand both the strengths and the gaps in AI-generated code. Based in Poland (CET timezone). Available for async work and calls during EU/US business hours. Nam Tran Nam Tran 10 years as fullstack developer Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Do Firebase push notifications work on iOS Safari?

Yes, but only since iOS 16.4 and only for apps added to the Home Screen (PWA). Standard Safari doesn't support Web Push. For full iOS support, you need a native app wrapper or use a service like OneSignal that handles the complexity.

Why do notifications work in development but not in production?

Common causes: the firebase-messaging-sw.js file isn't in the production build output, the VAPID key is different between environments, or the Firebase project used in development differs from production. Verify all Firebase config values match your production Firebase project.

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help