Add maskable icon

This commit is contained in:
Nicolas Mowen 2024-07-20 13:47:25 -06:00
parent 242c254cce
commit 104d56af25
4 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,6 @@ def migrate(migrator, database, fake=False, **kwargs):
migrator.add_fields( migrator.add_fields(
User, User,
notification_tokens=JSONField(default=[]), notification_tokens=JSONField(default=[]),
) )

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -8,16 +8,11 @@ self.addEventListener("push", function (event) {
// @ts-expect-error we know this exists // @ts-expect-error we know this exists
self.registration.showNotification(data.title, { self.registration.showNotification(data.title, {
body: data.message, body: data.message,
icon: data.image, icon: "/images/maskable-icon.png",
image: data.image, image: data.image,
badge: "/images/maskable-badge.png",
tag: data.id, tag: data.id,
data: { id: data.id, link: data.direct_url }, data: { id: data.id, link: data.direct_url },
actions: [
{
action: `view-${data.id}`,
title: "View",
},
],
}); });
} else { } else {
// pass // pass

View File

@ -20,6 +20,12 @@
"sizes": "180x180", "sizes": "180x180",
"type": "image/png", "type": "image/png",
"purpose": "maskable" "purpose": "maskable"
},
{
"src": "/images/maskable-badge.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable"
} }
], ],
"theme_color": "#ffffff", "theme_color": "#ffffff",