title: Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM
body: <p>I got this code from my client iOS app on XCode console </p>
  
  <p><a href="https://i.stack.imgur.com/IYl7I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IYl7I.png" alt="enter image description here"></a></p>
  
  <p>Firebase registration token: <code>diWY78iar8s:APA91bHJAzXe384OEYvfk4bKsyS1NQvteph7DwG7JRIMm_HuXg8EeNllVrsSi0v9W_Gh95ezbOStp3ZWuWl0AzFKxMaCOjN81yiz7A5qhkONrd7lP2CTkUbFErw28r3ONTLvo8c8sO7h
  diWY78iar8s:APA91bHJAzXe384OEYvfk4bKsyS1NQvteph7DwG7JRIMm_HuXg8EeNllVrsSi0v9W_Gh95ezbOStp3ZWuWl0AzFKxMaCOjN81yiz7A5qhkONrd7lP2CTkUbFErw28r3ONTLvo8c8sO7h</code></p>
  
  <h1>NodeJS</h1>
  
  <pre><code>console.log("START");
  var FCM = require('fcm-node');
  var serverKey = require('/Users/bheng/Desktop/Apps/APNS/node/mhn-app-firebase-adminsdk-bs45c-5ac3770488.json')
  var fcm = new FCM(serverKey)
  var collapseKey = 'new_message';
  var message = {
      to: 'diWY78iar8s:APA91bHJAzXe384OEYvfk4bKsyS1NQvteph7DwG7JRIMm_HuXg8EeNllVrsSi0v9W_Gh95ezbOStp3ZWuWl0AzFKxMaCOjN81yiz7A5qhkONrd7lP2CTkUbFErw28r3ONTLvo8c8sO7hdiWY78iar8s:APA91bHJAzXe384OEYvfk4bKsyS1NQvteph7DwG7JRIMm_HuXg8EeNllVrsSi0v9W_Gh95ezbOStp3ZWuWl0AzFKxMaCOjN81yiz7A5qhkONrd7lP2CTkUbFErw28r3ONTLvo8c8sO7h',
      data: {
          cpeMac: '000000000000',
          type: 'malware'
      },
      notification: {
          title: 'Hello baby',
          body: 'Nice body',
          tag: collapseKey,
          icon: 'ic_notification',
          color: '#18d821',
          sound: 'default',
      },
  };
  
  
  fcm.send(message, function(err, response){
      if (err) {
          console.log("Something has gone wrong!")
  
          console.log(JSON.stringify(err));
  
      } else {
          console.log("Successfully sent with response: ", JSON.stringify(response))
      }
  })
  
  console.log("END");
  </code></pre>
  
  <hr>
  
  <h1>Result</h1>
  
  <p>When I run it</p>
  
  <pre><code>node app.js  
  </code></pre>
  
  <p>I kept getting </p>
  
  <pre><code>START                                                                                 
  END                                                                                   
  Successfully sent with response:  {"results":[{"error":{"code":"messaging/invalid-registration-token","message":"Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM."}}],"canonicalRegistrationTokenCount":0,"failureCount":1,"successCount":0,"multicastId":7577724855311354000}
  </code></pre>
  
  <p>How would one go about debugging this further?</p>