title: cordova-plugin-fcm - FCMPlugin is not defined
body: <p>I am using Ionic 2, and am trying to get Push Notifications working.</p>
  
  <p>I have registered my app with Firebase, and can push notifications to it successfully.</p>
  
  <p>I now need to set up, so that I can push notifications from my app. So I decided to use the following Cordova Plugin (<a href="https://www.npmjs.com/package/cordova-plugin-fcm" rel="nofollow">cordova-plugin-fcm</a>).</p>
  
  <p><strong>Question 1</strong></p>
  
  <p>When I follow it's instructions, by doing the following in my Ionic app:</p>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>declare var FCMPlugin;
  ...
  
    initializeApp() {
      this.platform.ready().then(() =&gt; {
  ...
      FCMPlugin.getToken(
        function (token) {
  ....
  </code></pre>
  
  <p>I get the following Error at runtime:</p>
  
  <blockquote>
    <p>EXCEPTION: Error: Uncaught (in promise): ReferenceError: FCMPlugin is
    not defined</p>
  </blockquote>
  
  <p>How do I solve this please?</p>
  
  <p><strong>Question 2</strong></p>
  
  <p>In order to send notifications from your app, the Cordova Plugin (<a href="https://www.npmjs.com/package/cordova-plugin-fcm" rel="nofollow">cordova-plugin-fcm</a>) instructs the following:</p>
  
  <pre><code>//POST: https://fcm.googleapis.com/fcm/send 
  //HEADER: Content-Type: application/json 
  //HEADER: Authorization: key=AIzaSy******************* 
  {
    "notification":{
      "title":"Notification title",  //Any value 
      "body":"Notification body",  //Any value 
      "sound":"default", //If you want notification sound 
      "click_action":"FCM_PLUGIN_ACTIVITY",  //Must be present for Android 
      "icon":"fcm_push_icon"  //White icon Android resource 
    },
    "data":{
      "param1":"value1",  //Any data to be retrieved in the notification callback 
      "param2":"value2"
    },
      "to":"/topics/topicExample", //Topic or single device 
      "priority":"high", //If not set, notification won't be delivered on completely closed iOS app 
      "restricted_package_name":"" //Optional. Set for application filtering 
  }
  </code></pre>
  
  <p>This is not even Typescript or Javascript. So where does it go? I just don't understand. Any advise appreciated.</p>