title: Firebase cloud message/notifications are not receiving. JS
body: <p>I am trying to send FCM to my react app using cloud functions.
  Cloud function is executing, but notification is not being received on client side. </p>
  
  <p>Here cloud function code. </p>
  
  <pre><code>exports.sendPush = functions.database.ref('/settings2').onWrite(event =&gt; {
      let projectStateChanged = false;
      let projectCreated = false;
      let projectData = event.data.val();
      if (!event.data.previous.exists()) {
          projectCreated = true;
      }
      if (!projectCreated &amp;&amp; event.data.changed()) {
          projectStateChanged = true;
      }
      let msg = 'A project state was changed';
          if (projectCreated) {
              msg = `The following new project was added to the project: ${projectData.title}`;
          }
      tokens.push("fIGxxxxGtDGxxxx DEVICE Token");
      let payload = {
          notification: {
              title: 'Firebase Notification',
              body: 'This Is Message',
              sound: 'default',
              badge: '1'
          }
      };
      return admin.messaging().sendToDevice(tokens, payload);
  });
  </code></pre>
  
  <p>Here is the log of Cloud function</p>
  
  <p><a href="https://i.stack.imgur.com/V4g6P.png" rel="noreferrer"><img src="https://i.stack.imgur.com/V4g6P.png" alt="enter image description here"></a></p>
  
  <p>And here is code on my client side:</p>
  
  <pre><code>messaging.onMessage(function(payload) {
     console.log("Message received. ", payload);
        // ...
  });
  </code></pre>
  
  <p>There are not any errors, but nothing is in console. Do I have to do something with service worker file?</p>
  
  <p>Any help would be appreciated. </p>