title: OneSignal plugin doesn't work
body: <p>First of all, could someone explain me how OneSignal works? Can I use it to receive notifications when someone insert something in my Firebase Database? </p>
  
  <p>I need to use OneSignal plugin in my Ionic App. I installed it by</p>
  
  <pre><code> ionic cordova plugin add onesignal-cordova-plugin
  </code></pre>
  
  <p>Then I added in my <code>app.components.ts</code> this</p>
  
  <pre><code>  // OneSignal Code start:
    // Enable to debug issues:
    // window["plugins"].OneSignal.setLogLevel({logLevel: 4, visualLevel: 4});
  
    var notificationOpenedCallback = function(jsonData) {
      console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
    };
  
    window["plugins"].OneSignal
      .startInit("58c4f617-632a-.....", "5...")
      .handleNotificationOpened(notificationOpenedCallback)
      .endInit();
  </code></pre>
  
  <p>But I got an error when I launch <code>ionic serve</code>, it says</p>
  
  <pre><code>Uncaught (in promise): TypeError: Cannot read property 'OneSignal' of undefined
  TypeError: Cannot read property 'OneSignal' of undefined
  </code></pre>
  
  <p>I searched all the web but it seems the procedure to include this plugin is the previous so i can't undertand why it doesn't work. I've looked in my plugin folder too in the <code>android.json</code> and <code>fetch.json</code> files. I can post them here.</p>
  
  <p>android.json</p>
  
  <pre><code>"onesignal-cordova-plugin": {
    "PACKAGE_NAME": "io.ionic.starter"
  }
  </code></pre>
  
  <p>fetch.json</p>
  
  <pre><code>"onesignal-cordova-plugin": {
  "source": {
    "type": "registry",
    "id": "onesignal-cordova-plugin"
  }
  </code></pre>
  
  <p>I've installed <code>"@ionic-native/onesignal": "^4.6.0",</code> too but I can't understand if I need it too. </p>