Is there a way to specify the time i want the notification to be on the screen? Or just leave it be until its closed. This is the code:

    self.addEventListener('notificationclick', function(event) {
    //console.log('[Service Worker] Notification click Received.');

    var url = event.notification.data.url;

    //console.log('[Service Worker] event url = ' + url );
    //console.log(event);

    event.notification.close();

    // ensure the browser doesn't terminate our service worker before our new window has been displayed.
    event.waitUntil(
        clients.openWindow( url )
    );
});

Read more here: Set notifications time in google firebase


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: