firebase-messaging
FCM/GCM push notification client
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 on this page — 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
firebase-messaging on PyPI
pip
pip install firebase-messaginguv
uv add firebase-messagingpoetry
poetry add firebase-messagingInstalling 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 the current Python release (>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aiohttp, cryptography, http-ece, protobuf |
| Maintenance | actively maintained — 461 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 191,754/month — #9,876 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: firebase_messaging-0.4.5-py3-none-any.whl
Keywords: Firebase, Firebase Cloud Messaging, Google Cloud Messaging
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyfcmPyFCM is a Python client for Firebase Cloud…
permissive · top 15,000 on PyPI
pushbullet.pyA Python client library for the Pushbullet API…
permissive · top 15,000 on PyPI
fcm-djangoDjango app that integrates Firebase Cloud…
permissive · top 15,000 on PyPI
exponent-server-sdkSends push notifications to Expo mobile apps…
permissive · top 15,000 on PyPI
django-push-notificationsA Django app that manages device registrations…
permissive · top 15,000 on PyPI
Farama-NotificationsProvides a notification system that Farama…
permissive · top 5,000 on PyPI
pypushdeerA Python SDK for sending push notifications…
permissive · top 15,000 on PyPI
firebase-functionsFirebase Functions Python SDK lets you write…
permissive · top 15,000 on PyPI
pubnubPubNub Python SDK provides real-time…
unclear · top 15,000 on PyPI
pushover-completeA Python client library for the Pushover…
permissive · top 15,000 on PyPI