feat: instant meeting browser notifcations (#16480)
* feat: instant meeting browser notifcations * chore: support multiple notifications * chore: save progress * fix: add test notification and move file * fix: type err * chore: feedback improvements * chore: undo DENY
This commit is contained in:
1 parent
5bc0e1265d
commit
860d173f0a
9 files changed
+220
-37
No files matched your search
@@ -21,17 +21,28 @@ export const sendNotification = async ({
|
||||
title,
|
||||
body,
|
||||
icon,
|
||||
url,
|
||||
actions,
|
||||
requireInteraction,
|
||||
}: {
|
||||
subscription: Subscription;
|
||||
title: string;
|
||||
body: string;
|
||||
icon?: string;
|
||||
url?: string;
|
||||
actions?: { action: string; title: string; type: string; image: string | null }[];
|
||||
requireInteraction?: boolean;
|
||||
}) => {
|
||||
try {
|
||||
const payload = JSON.stringify({
|
||||
title,
|
||||
body,
|
||||
icon,
|
||||
data: {
|
||||
url,
|
||||
},
|
||||
actions,
|
||||
requireInteraction,
|
||||
});
|
||||
await webpush.sendNotification(subscription, payload);
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user