Skip to main content

No project description provided

Project description

🔔 Push Dispatcher

Push Dispatcher is a simple and reusable service for sending push notifications using Firebase Cloud Messaging (FCM) in Django projects.

Send targeted messages to device tokens or broadcast to topics — with built-in support for Android and iOS.


🚀 Features

  • 🔹 Send push notifications to device tokens
  • 🔹 Broadcast messages to topics
  • 🔹 Subscribe/unsubscribe devices from topics
  • 🔹 Supports APNs (iOS) and message priority
  • 🔹 Uses Firebase service account for secure messaging

⚙️ Quick Setup

1. Install Dependencies

pip install firebase-admin requests

2. Firebase Setup

  • Go to the Firebase Console
  • Create a project (if you haven’t already)
  • Navigate to Project Settings > Service Accounts
  • Click "Generate new private key"
  • Save the downloaded .json file to your Django project

3. Add to settings.py

# settings.py

INSTALLED_APPS = [
    ...
    "push_dispatcher",
]

FCM_PROJECT_ID = "your-firebase-project-id"
FIREBASE_SERVICE_ACCOUNT_KEY_PATH = "path/to/serviceAccountKey.json"

4. Send Notifications

from push_dispatcher.notifications import FirebasePushService

dispatcher = PushNotificationDispatcher()

# Send to device tokens
dispatcher.send_to_tokens(
    tokens=["device_token_1", "device_token_2"],
    title="Hello",
    body="This is a test notification",
    custom_key="value"  # Optional additional data
)

# Send to a topic
dispatcher.send_to_topic(
    topic="news-updates",
    title="Breaking News",
    body="Check out the latest story!"
)

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

django_push_dispatcher-0.1.7.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_push_dispatcher-0.1.7-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file django_push_dispatcher-0.1.7.tar.gz.

File metadata

  • Download URL: django_push_dispatcher-0.1.7.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for django_push_dispatcher-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f593269af7b49970a9ea99093c326450cd8622ef48db2bc86e9d431179d386af
MD5 74d67ccdede75af1f88da4f20f05c629
BLAKE2b-256 ed737facba24d3954666d254012fc10ebb36981e51d3da354ce0a33a24ef18a8

See more details on using hashes here.

File details

Details for the file django_push_dispatcher-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for django_push_dispatcher-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a60556214ddd1d66d435b42d0d8ec61a0245590ca36d1fb0f5c216c6482ef241
MD5 03e14171526566075cd8fa7d12e2b3e7
BLAKE2b-256 e561569d226c2257b0bc5346f45920e66767fc83aeb5120a0208dee857470c36

See more details on using hashes here.

Supported by

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