fix: add badge and tag to simple push notifications (#2299)

This commit is contained in:
Thomas Broyer 2022-12-09 17:22:36 +01:00 committed by GitHub
parent 380d2a0d45
commit d31c800806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,8 +185,10 @@ self.addEventListener('push', event => {
async function showSimpleNotification (data) { async function showSimpleNotification (data) {
await self.registration.showNotification(data.title, { await self.registration.showNotification(data.title, {
badge: '/icon-push-badge.png',
icon: data.icon, icon: data.icon,
body: data.body, body: data.body,
tag: data.notification_id,
data: { data: {
url: `${self.origin}/notifications` url: `${self.origin}/notifications`
} }