AppCenter Shared Plugin in Ionic 4


#1

I’m using cordova AppCenter Shared plugin inside Ionic4 app and calling function, I was able to get ID in console, but cannot assign it to public variable, any ideas?:

public deviceId: string = '';

this._window.AppCenter.getInstallId(function(success, error) {
          console.log(success);
          this.deviceId = success;        
      });

#2

This should work for you.

(<any>window).AppCenter.getInstallId( id => {
    console.log(id)
    this.deviceId = id;
});