Skip to content

Commit

Permalink
fix options
Browse files Browse the repository at this point in the history
  • Loading branch information
bonbud-macryg committed Jul 19, 2024
1 parent ce706a7 commit 5db983e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions sw.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
self.addEventListener('push', () => {
self.registration.showNotification('Hello world!', options);
self.addEventListener('push', function(e) {
var options = {
body: 'This notification was generated from a push!',
icon: 'images/example.png',
vibrate: [100, 50, 100],
data: {
dateOfArrival: Date.now(),
primaryKey: '2'
},
actions: [
{
action: 'explore',
title: 'Explore this new world',
// icon: 'images/checkmark.png'
},
{
action: 'close',
title: 'Close',
icon: 'images/xmark.png'
}
]
};
e.waitUntil(
self.registration.showNotification('Hello world!', options)
);
});

0 comments on commit 5db983e

Please sign in to comment.