Notifications won’t work from a file. You’re opening this page from your computer (file://). Browsers only allow notification prompts on a proper URL (e.g. http://localhost). Run a local server in this folder, then open the URL it gives you. Example in terminal: npx serve . then open http://localhost:3000.
Use HTTPS for Install & notifications. This page is loaded over HTTP. To get the Install app option and push notifications on your phone, open the site over HTTPS (e.g. deploy to a host with SSL or use a tunnel like ngrok).
FREE DADDY
We'll notify you when we have updates
Get in Touch
Leave your details and we’ll reach out. Enable notifications to get updates instantly.
Push notifications
Get notified when we reply or when there’s news. You can turn this off anytime.
Status: Not requested
Notifications are blocked. Please enable them in browser settings.
Install as app
Add this site to your home screen to open it like an app.
How to add to home screen (mobile)
Android (Chrome): Tap menu (⋮) → Install app or Add to Home screen.
iPhone (Safari): Tap the Share button (□↑) → Add to Home Screen.
If you don’t see “Install app”, use the site over HTTPS (not HTTP).
This guide walks you through setting up Web Push notifications end-to-end with Firebase. Add your own screenshots in the screenshots/ folder (see filenames under each figure) to make the guide easier to follow.
1. Prerequisites
Before you start, ensure you have:
HTTPS or localhost — Browsers only allow push on secure origins. Use http://localhost for development or HTTPS in production.
Run npm run generate-config to build firebase-config.js (or run npm start, which runs it automatically).
Figure 4: .env file and running generate-config. (Add screenshots/04-env-and-generate.png)
5. Service worker
This project uses firebase-messaging-sw.js in the site root. It must be served from the same origin as your page. The service worker handles background push when the tab is closed or in the background.
6. Request permission & get the FCM token
On your page, call Notification.requestPermission() to show the browser prompt. If the user allows, call messaging.getToken({ vapidKey }) to get the FCM token. Store this token on your backend (e.g. with the user’s email) to send targeted push later.
Figure 5: User allows notifications; FCM token appears. (Add screenshots/05-enable-notifications.png)
7. Send a notification
Option A — Firebase Console: Engage → Messaging → Create campaign → Firebase Notification messages. Compose and send to a segment or test token.
Figure 6: Create a notification campaign in Firebase Console. (Add screenshots/06-firebase-messaging-campaign.png)
Option B — Your backend (FCM HTTP v1): Use Firebase Admin SDK or the FCM HTTP v1 API with a service account. Send the user’s FCM token and your notification payload.
// Example (Node with firebase-admin):
const message = {
notification: { title: 'Hello', body: 'You have an update.' },
token: userFcmToken
};
await admin.messaging().send(message);
8. Summary
End-to-end flow: Create Firebase project → Add web app + get config & VAPID key → Put them in .env and generate firebase-config.js → Serve the site over HTTPS/localhost → User allows notifications and gets FCM token → Your backend or Firebase Console sends push using that token.
Theme & brand color
Theme
Brand color
Custom
Color applies to headings, buttons, and accents across the site.