read message_delivery_method_web_push_vapid_public_key from public settings db
Main daploy / deploy (push) Successful in 43s
Main daploy / deploy (push) Successful in 43s
This commit is contained in:
@@ -22,13 +22,30 @@ const notification = {
|
||||
options: {
|
||||
icon: "/images/qr-code-logo-200x200.jpg",
|
||||
body: "Test push message from DevTools.",
|
||||
tag: "2105ef6f-3ca6-4f99-b258-0ca23f014309",
|
||||
tag: "01936062-d10f-7f2f-8ae3-dd7f9fbc5c7f",
|
||||
vibrate: [200, 100, 200, 100, 200, 100, 200],
|
||||
data: {
|
||||
url: "http://localhost:5173/chat/6ilhxu/13trvu",
|
||||
payload: { tag: "01936062-d10f-7f2f-8ae3-dd7f9fbc5c7f" },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const notification2 = {
|
||||
type: "notification",
|
||||
notification: {
|
||||
title: "test",
|
||||
options: {
|
||||
icon: "/images/qr-code-logo-200x200.jpg",
|
||||
body: "Test push message from DevTools.",
|
||||
tag: "01936062-d10f-7f2f-8ae3-dd7f9fbc5c7f",
|
||||
// requireInteraction: true,
|
||||
// silent: false,
|
||||
// vibrate: [200, 100, 200, 100, 200, 100, 200],
|
||||
data: {
|
||||
url: "/chat/6ilhxu/13trvu",
|
||||
payload: { tag: "2105ef6f-3ca6-4f99-b258-0ca23f014309" },
|
||||
payload: { tag: "01936062-d10f-7f2f-8ae3-dd7f9fbc5c7f" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -50,7 +67,7 @@ const { rows } = await new PouchDB(
|
||||
},
|
||||
);
|
||||
|
||||
await Promise.allSettled(
|
||||
const result = await Promise.allSettled(
|
||||
rows.map(async ({ doc }) => {
|
||||
await webpush.sendNotification(
|
||||
doc.subscription,
|
||||
@@ -59,6 +76,7 @@ await Promise.allSettled(
|
||||
console.log("sent ", doc._id);
|
||||
}),
|
||||
);
|
||||
console.log(result);
|
||||
|
||||
// issues:
|
||||
// 1. NO SOUND
|
||||
|
||||
Reference in New Issue
Block a user