summaryrefslogtreecommitdiff
path: root/backend/notif.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/notif.py')
-rw-r--r--backend/notif.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/backend/notif.py b/backend/notif.py
index 57ccc23..46e7693 100644
--- a/backend/notif.py
+++ b/backend/notif.py
@@ -48,7 +48,7 @@ def subscribe(data: PushSubscriptionData):
# --- send notification
# ---- not used yet
-def send_notification(endpoint: str):
+def send_notification(endpoint: str, notification_payload: object):
cursor.execute("SELECT * FROM subscriptions WHERE endpoint = ?", (endpoint,))
row = cursor.fetchall()[0]
print(row)
@@ -64,12 +64,7 @@ def send_notification(endpoint: str):
try:
webpush(
subscription_info=subscription_info,
- data="""
- {
- "title": "Hello, world!",
- "body": "Hello, Victoria Hall!"
- }
- """,
+ data=notification_payload,
vapid_private_key=PRIVATE_VAPID_KEY,
vapid_claims={
"sub": "mailto:dev@altafcreator.com",