title: OneSignal issue for Ionic 6 & Capacitor
body: <p>I'm trying to set OneSignal for push notifications on devices.
  I did the step by step to setup methods which are shown in the OneSignal Documentation, but no luck.</p>
  <p>I also did the official Ionic - Capacitor - Cordova methods to setup OneSignal, with no luck again.</p>
  <p>This is the first method I did, following Ionic official Docs:</p>
  <p>app.module.ts</p>
  <pre><code>...
  import { OneSignal } from '@awesome-cordova-plugins/onesingal';
  
  @NgModule({
      ...
      providers: [OneSignal]
  });
  </code></pre>
  <p>I created a PushService where I include methods from OneSignal.</p>
  <p>push.service.ts:</p>
  <pre><code>import { OneSignal } '@awesome-cordova-plugins/onesignal';
  
  export class PushService {
      constructor ( private signal: OneSignal ) {}
  
      start (): void {
          this.signal.startInit ( 'MY_ONESIGNAL_APP_ID', 'FIREBASE_ID' );
          this.signal.handleNotificationReceived().subscribe(() =&gt; {
              // do something when notification is received
          });
          ...
          this.signal.endInit();
      }
  }
  </code></pre>
  <p>I call &quot;start&quot; method on my app.component.ts, initializing on this.platform.ready...
  And when I test on my device, the answer from debug is &quot;plugin_not_installed&quot; OneSignal</p>
  <hr />
  <p>Second method I use, following instructions from the Official OneSignal Docs &quot;Ionic &amp; Capacitor&quot;</p>
  <p>Directly I put methods on my &quot;start&quot; in push.service.ts, I didn't call it on app.module.ts because is a function:</p>
  <pre><code>import { OneSignal } from 'onesignal-cordova-plugin';
  
  export class PushService {
      constructor () {}
      start (): void {
          OneSignal.setAppId ( 'ONESIGNAL_APP_ID' );
          ...
          OneSignal.setNotificationWillShowInForegroundHandler ( ( d ) =&gt; console.log ( d ) );
      }
  }
  </code></pre>
  <p>In this case, the error is &quot;TypeError: Cannot read properties of undefined (reading 'setAppId')&quot;
  So, any of those methods is not working.</p>
  <p>My system info develop is:</p>
  <pre><code>Ionic:
  
     Ionic CLI                     : 6.18.1 (C:\Users\user\AppData\Roaming\npm\node_modules\@ionic\cli)
     Ionic Framework               : @ionic/angular 6.0.1
     @angular-devkit/build-angular : 13.1.2
     @angular-devkit/schematics    : 12.2.13
     @angular/cli                  : 13.1.2
     @ionic/angular-toolkit        : 5.0.3
  
  Capacitor:
  
     Capacitor CLI      : 3.3.3
     @capacitor/android : 3.3.3
     @capacitor/core    : 3.3.3
     @capacitor/ios     : not installed
  
  Utility:
  
     cordova-res : not installed globally
     native-run  : 1.5.0
  
  System:
  
     NodeJS : v16.13.1 (C:\Program Files\nodejs\node.exe)
     npm    : 8.2.0
     OS     : Windows 10
  </code></pre>