Skip to main content

Push Notifications with FCM

This guide covers the Firebase Cloud Messaging (FCM) implementation for push notifications.

Overview

Push notifications keep users engaged by alerting them to new content, messages, appointments, and other important updates even when they're not actively using the app.

How It Works

  1. User grants permission - Browser asks for notification permission
  2. FCM token generated - Unique token for this device/browser
  3. Token stored - Saved in database linked to user
  4. Server sends notification - Edge function sends to FCM
  5. FCM delivers - Push arrives on user's device

User Guide

Enabling Notifications

  1. Open the app
  2. You may see a prompt asking "Allow notifications?"
  3. Click Allow or Accept
  4. That's it! You'll now receive push notifications

If You Missed the Prompt

  1. Go to Settings in the app
  2. Find Notifications
  3. Click Enable Push Notifications
  4. Accept the browser permission

Managing Notifications

Most notification settings can be found in:

  • App SettingsNotifications

You can typically control:

  • Which types of notifications you receive
  • Quiet hours
  • Sound settings

Troubleshooting

Not Receiving Notifications

Check browser permissions:

  1. Click the lock icon in your browser's address bar
  2. Find "Notifications"
  3. Make sure it's set to "Allow"

Check in-app settings:

  1. Go to Settings → Notifications
  2. Make sure notifications are enabled

Try re-enabling:

  1. Disable notifications in app settings
  2. Wait a few seconds
  3. Enable them again
  4. Accept the browser prompt

Notifications Delayed

Push notifications should arrive within seconds, but delays can happen due to:

  • Poor internet connection
  • Device battery saver mode
  • Too many apps sending notifications

No Sound

Check your device settings:

  • Make sure device is not on silent/vibrate
  • Check notification sound settings
  • Some browsers don't support notification sounds

Best Practices

For Users

  • Keep the app updated - Install PWA updates when prompted
  • Don't disable notifications for important apps
  • Check settings periodically - Make sure your preferences are correct

For Admins

  • Don't over-notify - Too many notifications lead to users disabling them
  • Make notifications actionable - Each notification should have a clear purpose
  • Test notifications regularly - Ensure they're working correctly