I'm using Google Chrome Service Worker to implement a push notification service for my web-users.
Given Chrome current security constraints is not possible to send a payload so I'm fetching the content from my webserver, however is quite complicated to identify at service side which end user is querying for the push payload
Is it possible to get information of the pushSubscription.endpoint or any form or unique identification about yhthat my service-worker is connected to?
Inside the service worker you can use self.registration.pushManager.getSubscription()
.
self.registration.pushManager.getSubscription().then(function(subscription) {
if (subscription) {
// do something with subscription.endpoint
}
});