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.

Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. Milan Surelia Milan Surelia Milan Surelia is a Mobile App Developer with 5+ years of experience crafting scalable, cross-platform apps at 7Span and Meticha. At 7Span, he engineers feature-rich Flutter apps with smooth performance and modern UI. As the Co-Founder of Meticha, he builds open-source tools and developer-focused products that solve real-world problems. Expertise: 💡 Developing cross-platform apps using Flutter, Dart, and Jetpack Compose for Android, iOS, and Web. 🖋️ Sharing insights through technical writing, blogging, and open-source contributions. 🤝 Collaborating closely with designers, PMs, and developers to build seamless mobile experiences. Notable Achievements: 🎯 Revamped the Vepaar app into Vepaar Store & CRM with a 2x performance boost and smoother UX. 🚀 Launched Compose101 — a Jetpack Compose starter kit to speed up Android development. 🌟 Open source contributions on Github & StackOverflow for Flutter & Dart 🎖️ Worked on improving app performance and user experience with smart solutions. Milan is always happy to connect, work on new ideas, and explore the latest in technology. Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools. David Olverson David Olverson Solo dev shipping production apps with AI-assisted development. I specialize in rescuing broken Lovable/Bolt/Cursor builds and taking them to production. 10+ apps shipped including SaaS CRMs, gaming platforms, real estate tools, and Discord bots. Stack: Next.js 16, TypeScript, Tailwind CSS, FastAPI, PostgreSQL, Prisma. I use Claude Code with 50+ custom skills for rapid delivery. Average turnaround: 2-4 weeks from broken prototype to production. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. 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. Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system.

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