Metadata-Version: 2.4
Name: django-push-dispatcher
Version: 0.1.5
Classifier: Programming Language :: Python :: 3
Classifier: Framework :: Django
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django<5.2,>=3.0
Requires-Dist: firebase-admin>=5.0.0
Requires-Dist: requests>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: tox; extra == "dev"
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python

Glad you liked the setup! Here's a polished and super-readable version of your `README.md` section with clean formatting, ideal for both new users and experienced devs:

---

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

```bash
pip install firebase-admin requests
```

---

### 2. Firebase Setup

- Go to the [Firebase Console](https://console.firebase.google.com)
- 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`

```python
# 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

```python
from push_dispatcher.notifications import PushNotificationDispatcher

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!"
)
```

---

Let me know if you want to add **error handling**, **response examples**, or **Django integration tips** too!
