title: How to get the OneSignal playerID
body: <p>I need to store the playerID when the user accepts the notifications when launching the app. This is on the initializeApp function in app.component.ts.</p>
  <p>I can get the playerID (I can show it with console.log) but when I try to set it as a local storage, it doesn't work. Here my app.component.ts:</p>
  <pre class="lang-ts prettyprint-override"><code>initializeApp() {
      if (this.platform.ready()) {
        this.platform.ready().then((res) =&gt; {
          console.log(res);
          if (res == 'cordova') {
                  this.oneSignal.startInit('xxx-xxx-xxx', 'xxx');
                  this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
                  this.oneSignal.getIds().then((ids) =&gt; {
                    this.nativeStorage.setItem('playerID', ids.userId);
                  });
                  this.oneSignal.handleNotificationReceived().subscribe((message) =&gt; {
                      // do something when notification is received
                 
                  });
                  this.oneSignal.handleNotificationOpened().subscribe(() =&gt; {
                      // do something when a notification is opened
                  });
  
                  this.oneSignal.endInit();
                  
            // console.log(this.oneSignal.startInit('b8320a40-f565-4593-b9aa-d98b580bf8e1', '323509745034'));
            // this.oneSignal.getIds().then(response=&gt;{
            //   console.log(response);
            //     });
            // this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
            // this.oneSignal.handleNotificationReceived().subscribe(() =&gt; {
            // });
            // this.oneSignal.handleNotificationOpened().subscribe(() =&gt; {
            // });
            // this.oneSignal.endInit();
          }
        });
      }
    }
  </code></pre>