title: FCM service worker setBackgroundMessageHandler
body: <p>I have tried to use FCM (<a href="https://firebase.google.com/docs/cloud-messaging/" rel="nofollow noreferrer">Firebase Cloud Messaging</a>) for Web Push Notification.
  I successfully received a message when the web app tab was on focus.</p>
  
  <p>But when I closed the tab, it was supposed to call the service worker ( which is <code>firebase-messaging-sw.js</code> in FCM sample ). But it didn't call the <code>setBackgroundMessageHandler</code> at all.</p>
  
  <pre><code>const messaging = firebase.messaging();
  messaging.setBackgroundMessageHandler(function(payload) {
    console.log('[firebase-messaging-sw.js] Received background message ', payload);
    const notificationTitle = 'Background Message Title';
    const notificationOptions = {
      body: 'Background Message body.',
      icon: 'firebase-logo.png'
    };
  
    return self.registration.showNotification(notificationTitle,
        notificationOptions);
  });
  </code></pre>