Firebase Notifications

Push notifications using FCM

Install Firebase Notifications

bench get-app https://github.com/rohankumbhar-01/firebase_notifications

Add the Frappe Gems badge to your README

Maintain Firebase Notifications? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=rohankumbhar-01%2Ffirebase_notifications)](https://frappegems.com/gems/apps/rohankumbhar-01/firebase_notifications)

About Firebase Notifications

# Firebase Push Notifications for Frappe / ERPNext A production-ready integration between Frappe Framework (v15) and Firebase Cloud Messaging (FCM) to provide real-time desktop and mobile push notifications. ## 🚀 Features - **Global Integration**: Automatically pushes all Frappe system notifications (mentions, assignments, alerts) to the desktop. - **Workflow Triggers**: Real-time alerts for specific events (e.g., Sales Order Submission). - **Background Support**: Service Worker integration for receiving notifications even when the browser tab is closed. - **Token Management**: Automatic registration, refresh, and cleanup of stale device tokens. - **Singleton Pattern**: Efficient Firebase Admin SDK initialization. --- ## 🏗 Setup & Configuration Guide ### Step 1: Firebase Console Configuration 1. **Create a Project**: Go to the [Firebase Console](https://console.firebase.google.com/) and click **Add Project**. 2. **Generate Service Account**: - Project Settings > **Service Accounts**. - Click **Generate New Private Key**. - Save the JSON file; you will need its content for Frappe. 3. **Create Web App**: - Project Settings > **General**. - Register a new **Web App** (``). - Copy the `firebaseConfig` object values. 4. **Get VAPID Key**: - Cloud Messaging tab > **Web configuration**. - Generate key pair under **Web Push certificates**. Copy this long string. ### Step 2: Google Cloud API Activation 1. Open the [Google Cloud Library](https://console.cloud.google.com/apis/library/fcm.googleapis.com). 2. Select your project and click **Enable**. ### Step 3: Frappe / ERPNext Configuration 1. Search for **FCM Settings** in ERPNext. 2. **Firebase Client Config**: Fill in `API Key`, `App ID`, `Project ID`, etc., from your Web App config. 3. **VAPID Key**: Paste the key from Step 1.4. 4. **Admin SDK Setup**: Paste the entire content of the **Service Account JSON** file. 5. **Save & Refresh**: Hard refresh your browser (`Ctrl + F5` or `Cmd + Shift + R`). ### Step 4: Verification 1. **Permission**: Click **Allow** when the browser asks for notification permission. 2. **Test**: Go to the **FCM Device Token** list, open your token record, and click **Send Test Notification**. --- ## 🛠 Developer Customization ### Adding custom triggers Add your document events to `hooks.py`: ```python doc_events = { "Task": { "on_update": "firebase_notifications.firebase_notifications.api.my_custom_trigger" } } ``` ### Sending notifications via Python ```python from firebase_notifications.firebase_notifications.api import send_push_notification send_push_notification( users=["user@example.com"], title="Custom Title", body="Custom message body", data={"route": "/app/todo"} ) ``` ## 📄 License MIT

Related Integrations apps for Frappe & ERPNext

  • Insights — Open Source Business Intelligence Tool
  • Raven — Simple, open source team messaging platform
  • Frappe Whatsapp — WhatsApp cloud integration for frappe
  • Frappe Assistant Core — Infrastructure that connects LLMs to ERPNext. Frappe Assistant Core works with the Model Context Protocol (MCP) to expose ERPNext functionality to any compatible Language Model
  • Biometric Attendance Sync Tool — A simple tool for syncing Biometric Attendance data with your ERPNext server
  • Frappe React Sdk — React hooks for Frappe
  • Frappe Js Sdk — TypeScript/JavaScript library for Frappe REST API
  • Mcp — Frappe MCP allows Frappe apps to function as MCP servers