With Firebase Cloud Messaging (for web), how can I generate the notification that appears when the webpage is closed or in the background, but when I\'m actually focused on
More clean approach would be:
messaging.onMessage(payload => { const {title, ...options} = payload.notification; navigator.serviceWorker.ready.then(registration => { registration.showNotification(title, options); }); });