--- id: firebase-messaging version: "0.4.5" license: MIT license_treatment: permissive maintenance: active --- # firebase-messaging — FCM/GCM push notification client License: permissive · Maintenance: active · Downloads: 191.8K/mo ## What it is and what it does firebase-messaging is a Python client library for receiving push notifications delivered via Firebase Cloud Messaging (FCM) and Google Cloud Messaging (GCM). It handles the subscription handshake, credential management, and asynchronous message delivery to your application—useful when you need to listen for notifications on a backend or desktop Python process rather than on a mobile or web platform. The library runs inside an asyncio event loop and exposes a callback-based API: you provide a notification handler, Firebase credentials, and configuration, then call start() to begin listening. It manages the underlying HTTP/2 connection to FCM, handles encryption/decryption of incoming messages using http-ece and cryptography, and invokes your callback each time a notification arrives. It is not for sending notifications—use the official Firebase SDK for that. Use it for: - Receive FCM notifications in a Python backend service or daemon without deploying to Android, iOS, or Web. - Build a notification relay or aggregator that listens to FCM and forwards messages to other systems. - Monitor Firebase-sent alerts in a desktop or CLI application running on a developer's machine. - Integrate FCM message delivery into a Python async framework (e.g., FastAPI, aiohttp) for real-time event handling. - Test FCM notification flows in a Python test suite or integration environment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Receives push notifications sent via Firebase Cloud Messaging (FCM) in a Python application by subscribing to GCM/FCM endpoints and handling incoming messages asynchronously. Yes, if you need to receive FCM notifications in a Python application. The library is actively maintained, has low install friction, carries no known vulnerabilities, and supports modern Python versions. The MIT license imposes no restrictions. Install it only if you are receiving (not sending) notifications and your application is not already running on a supported FCM platform. ## Install pip install firebase-messaging uv add firebase-messaging poetry add firebase-messaging ## Installing firebase-messaging Before you install: Low friction install with four runtime dependencies (aiohttp, cryptography, http-ece, protobuf). Actively maintained with recent commits and support for current Python versions (3.9–3.13). License in practice: MIT license permits unrestricted use, modification, and distribution with minimal legal friction. Quickstart: from firebase_messaging import FcmPushClient, FcmRegisterConfig def on_notification(obj, notification, data_message): pass fcm_config = FcmRegisterConfig(project_id, app_id, api_key, sender_id) pc = FcmPushClient(on_notification, fcm_config, None, None) token = await pc.checkin_or_register() await pc.start() Must run inside an asyncio event loop; requires valid Firebase configuration (project ID, app ID, API key, message sender ID). Verify before relying: - Whether credentials persistence across restarts is automatic or requires manual file handling. - Supported FCM message payload size limits and format constraints. - Behavior when Firebase credentials expire or become invalid during a listening session. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 191.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fcm push notification receiver, firebase cloud messaging client, gcm notification listener python, receive firebase push notifications, fcm subscription handler, python push notification client, firebase messaging receiver, async-messaging, firebase-integration [View on SkillFed](https://skillfed.io/packages/firebase-messaging) · [View on PyPI](https://pypi.org/project/firebase-messaging/)