FCM/GCM push notification client
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file firebase_messaging-0.3.0.tar.gz
.
File metadata
- Download URL: firebase_messaging-0.3.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f4ecd81d78da25ddb50842f04b7f4a13ee401341c0d3ea0c1bd8492ba067f3b |
|
MD5 | 8af71dc8d200c211b1626ade40f9edf5 |
|
BLAKE2b-256 | 9dcfbfee121d1b9caf8e0e92f37ad9e26ebc6d2b0e15090ec72f55521efd5485 |
File details
Details for the file firebase_messaging-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: firebase_messaging-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a13fcd52e69316d0c9a8238a2df94d7a8c195883e83e8e89ed27a8815d70f5e0 |
|
MD5 | 8de93e6ea0fbb0e19062f58ab7eb3958 |
|
BLAKE2b-256 | c81c4ff7b08e217012af571ef99b3c9854939cd70cad0468686db33296b81704 |