I have implemented web push notifications using twilio. It works well on desktop and mobile phones.But, I am struggling to handle clicks on the notification on mobile. For desktop it works fine with the following code in the service worker
self.addEventListener('notificationclick', function(event) {
event.notification.close();
event.waitUntil(
clients.openWindow('https://example.com')
);
});
On mobile on clicking on the message nothing happens. I want to open a url in the browser when the user clicks on the message. Better if I can directly open the progressive web app.
Please suggest how to proceed.