I\'ve been trying to redirect users to the \"action\" part of Webpush coming from the backend (PHP).
return (new WebPushMessage)
->title(\'Title\'
Got a response from u-ryo on Github
There is a workaround. Add the codes below to ngsw-worker.js around the line this.scope.addEventListener('push', (event) => this.onPush(event));(Line 1775).
this.scope.addEventListener('notificationclick', (event) => {
console.log('[Service Worker] Notification click Received. event', event);
event.notification.close();
if (clients.openWindow && event.notification.data.url) {
event.waitUntil(clients.openWindow(event.notification.data.url));
}
});
Then you can specify the URL in the "notification.data.url".
https://github.com/angular/angular/issues/20956#issuecomment-374133852