summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/notif.py5
-rw-r--r--frontend/sw.js4
2 files changed, 6 insertions, 3 deletions
diff --git a/backend/notif.py b/backend/notif.py
index 8de4d4c..d454a7c 100644
--- a/backend/notif.py
+++ b/backend/notif.py
@@ -64,7 +64,10 @@ def send_notification(endpoint: str):
try:
webpush(
subscription_info=subscription_info,
- data="Hello, world!",
+ data={
+ "title": "Hello, world!",
+ "body": "Hello, Victoria Hall!"
+ },
vapid_private_key=PRIVATE_VAPID_KEY,
vapid_claims={
"sub": "mailto:dev@altafcreator.com",
diff --git a/frontend/sw.js b/frontend/sw.js
index 5dcf564..187a66b 100644
--- a/frontend/sw.js
+++ b/frontend/sw.js
@@ -1,7 +1,7 @@
self.addEventListener('push', (e) => {
const data = e.data.json();
console.log(data);
- self.registration.showNotification("notif received", {
- body: "received",
+ self.registration.showNotification(data.title, {
+ body: data.body,
});
});