This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
AWS.config.update({ region: 'us-east-1' }); | |
var s3 = new AWS.S3(); | |
var obj = { | |
firstname: "Navjot", | |
lastname: "Dhanawat" | |
}; | |
var buf = Buffer.from(JSON.stringify(obj)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//browser push notification "onClick" event heandler | |
self.addEventListener('notificationclick', function(event) { | |
console.log('[Service Worker] Notification click Received.'); | |
event.notification.close(); | |
/** | |
* if exists open browser tab with matching url just set focus to it, | |
* otherwise open new tab/window with sw root scope url | |
*/ | |
event.waitUntil(clients.matchAll({ |