title: How to get the notification title and body using cordova-plugin-fcm on an ionic 1 app
body: <p>I am using <a href="https://firebase.google.com/docs/cloud-messaging/http-server-ref" rel="nofollow noreferrer">Firebase Cloud Messaging HTTP Protocol</a> to send push notifications to my application using postman for testing.</p>
  <p>I am using the following code to send the push.</p>
  <pre><code>{
    &quot;notification&quot;:{
      &quot;title&quot;:&quot;Title&quot;,
      &quot;body&quot;:&quot;this is a notification to a specific topic&quot;,
      &quot;sound&quot;:&quot;default&quot;,
      &quot;click_action&quot;:&quot;FCM_PLUGIN_ACTIVITY&quot;,  
    },
    &quot;data&quot;:{
      &quot;action&quot;:&quot;ping&quot;
    },
    &quot;to&quot;:&quot;/topics/Topic_1&quot;,
    &quot;priority&quot;:&quot;high&quot;
  }
  </code></pre>
  <p>and I am using this code to handle the notification on my app:</p>
  <pre><code>FCMPlugin.onNotification(function(data){
      console.log(data);
      if(data.wasTapped){
        //Notification was received on device tray and tapped by the user. 
        alert('notification tapped'+ JSON.stringify(data) );
      }else{
        //Notification was received in foreground. Maybe the user needs to be notified. 
        alert('application is open'+ JSON.stringify(data) );
      }
  });
  </code></pre>
  <p>it is all working except i cannot get the title and the body to use them in my application, all I am getting is the following:</p>
  <blockquote>
  <p>Object {wasTapped: false, action: &quot;ping&quot;}</p>
  </blockquote>
  <p>I cannot find a way to get the notification title and body.</p>
  <p>I know I can copy them to the data section but that's not logical <em>its a dirty workaround</em></p>
  <p>so any idea how to get the notification data?
  thank you.</p>