WebPush notification update
This commit is contained in:
parent
947b509f0b
commit
9055b226f4
1 changed files with 3 additions and 3 deletions
6
sw.js
6
sw.js
|
|
@ -1,9 +1,9 @@
|
|||
self.addEventListener('push', event => {
|
||||
let data = {};
|
||||
try { data = event.data ? event.data.json() : {}; } catch (e) { data = { title: 'MVL', body: event.data ? event.data.text() : 'New article @ MVL!' }; }
|
||||
const title = data.title || 'MVL';
|
||||
try { data = event.data ? event.data.json() : {}; } catch (e) { data = { title: 'MVLog', body: event.data ? event.data.text() : 'New article @ MVLog!' }; }
|
||||
const title = data.title || 'MVLog';
|
||||
const options = {
|
||||
body: data.body || 'New article @ MVL!',
|
||||
body: data.body || 'New article @ MVLog!',
|
||||
icon: 'assets/img/moto_travel.png',
|
||||
badge: 'assets/img/moto_travel.png',
|
||||
data: { url: data.url || './' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue