AppCenter Shared Plugin in Ionic 4

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) {
          this.deviceId = success;        

This should work for you.

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