skillfed

firebase-messaging

FCM/GCM push notification client

firebase-messaging v0.4.5 191.8K downloads/30d#9,876 on PyPI14
Permissive license MIT Active released

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-messaging

uv

uv add firebase-messaging

poetry

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 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

Environment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

fcm push notification receiverfirebase cloud messaging clientgcm notification listener pythonreceive firebase push notificationsfcm subscription handlerpython push notification clientfirebase messaging receiver
async-messagingfirebase-integration

More Python Modules packages