diff --git a/push.js b/push.js index 4de426a..6413ed6 100644 --- a/push.js +++ b/push.js @@ -7,5 +7,5 @@ let vapidKeys = { push.setVapidDetails('mailto:@code.co.uk', vapidKeys.publicKey, vapidKeys.privateKey) -let sub = {} +let sub = {"endpoint":"https://fcm.googleapis.com/fcm/send/cYpbsEqV2Mc:APA91bHwJIclUhZ70TCfAWTJDyWsPM-uh11yrJc6O_vO2v7fViTaRu5QZbV66HDJUDsHKPXnRGrrkY8IkpTTmYf8QbfeN5GWSmBX762fZ4cGf-RoKYSjgG9XPnc2PQjCYVN48qqPOThK","expirationTime":null,"keys":{"p256dh":"BDDMvBH__dUnbEd0s4Rnfnru6lyIAHMOo9foGoL3miaxkyvyOJrfzinS8kpwFXXGT4qcyRTtBlZaU78Ul80JPWU","auth":"C2K00EPNsopcnB_NxsTssg"}} push.sendNotification(sub, 'test message') \ No newline at end of file diff --git a/sw.js b/sw.js index 5dba61a..04fda38 100644 --- a/sw.js +++ b/sw.js @@ -1,3 +1,3 @@ self.addEventListener('push', () => { - self.registration.sendNotification('test message', {}) -}) \ No newline at end of file + self.registration.showNotification('Hello world!', options); +}); \ No newline at end of file