-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw.js
26 lines (26 loc) · 840 Bytes
/
sw.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
self.addEventListener('push', function(e) {
var options = {
body: 'This notification was generated from a push!',
icon: 'https://ewr1.vultrobjects.com/urbit/hastuc-dibtux/2024.4.30..2.37.9..bae1.47ae.147a.e147-IMG_5592.jpeg',
vibrate: [100, 50, 100],
data: {
dateOfArrival: Date.now(),
primaryKey: '2'
},
actions: [
{
action: 'explore',
title: 'Explore this new world',
icon: 'https://ewr1.vultrobjects.com/urbit/hastuc-dibtux/2024.4.30..2.37.9..bae1.47ae.147a.e147-IMG_5592.jpeg'
},
{
action: 'close',
title: 'Close',
icon: 'https://ewr1.vultrobjects.com/urbit/hastuc-dibtux/2024.4.30..2.37.9..bae1.47ae.147a.e147-IMG_5592.jpeg'
}
]
};
e.waitUntil(
self.registration.showNotification('Hello world!', options)
);
});