Skip to main content

FCM/GCM push notification client

Project description

PyPI Version Build Status Coverage Documentation Status Py Versions

A library to subscribe to GCM/FCM and receive notifications within a python application.

When should I use firebase-messaging ?

  • I want to receive push notifications sent using Firebase Cloud Messaging in a python application.

When should I not use firebase-messaging ?

  • I want to send push notifications (use the firebase SDK instead)

  • My application is running on a FCM supported platform (Android, iOS, Web).

Install

PyPi:

$ pip install firebase-messaging

Requirements

  • Firebase sender id to receive notification

  • Firebase serverKey to send notification (optional)

Usage

python:

from firebase_messaging import FcmPushClient

def on_notification(obj, notification, data_message):
    # Do something with the notification
    pass

pc = FcmPushClient(None)
fcm_token = pc.checkin(sender_id, app_id)

# Notify the service you're connecting to of your FCM token

pc.start(YOUR_NOTIFICATION_CALLBACK)

Attribution

Code originally based on typescript/node implementation by Matthieu Lemoine. See this blog post for more details.

Converted to python by lolisamurai

http decryption logic in decrypt.py by Martin Thomson

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firebase_messaging-0.2.1.tar.gz (37.1 kB view details)

Uploaded Source

Built Distribution

firebase_messaging-0.2.1-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file firebase_messaging-0.2.1.tar.gz.

File metadata

  • Download URL: firebase_messaging-0.2.1.tar.gz
  • Upload date:
  • Size: 37.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for firebase_messaging-0.2.1.tar.gz
Algorithm Hash digest
SHA256 16d754c16edfd872eceae8ba85b8989fab811f4ff2654f9fcfd988ea565c326d
MD5 bcf997f8c3acf35d11d31f0a2db84635
BLAKE2b-256 fefcc9be993c4f3182ea94d0d255b5041638181a56cb6b9916d88916d6e7e8f6

See more details on using hashes here.

File details

Details for the file firebase_messaging-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for firebase_messaging-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46961137d131ab9d1603508e1111438a1ed4fb97093be7dbfbe789bc8424dd7c
MD5 b97341b7ee61a1e0127613a3c6f0b9be
BLAKE2b-256 bb2b0a74cb3172b23c400102e32f68ea4b22a6d51effde8c8f9c6188c52d838a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page