Auto authentication firebase is not working via app.component.ts

When i put an authStateChange and try to set root page accordingly to the user are or arent logged in, the page isnt load instantly, it appear a blank page. But when i resize the browser window the page appears.

I also tried changeDetectorRef, but it causes some bugs in my login form.

This is my app.component code

export class MyApp {
  rootPage: any;
  constructor(platform: Platform,
    statusBar: StatusBar,
    splashScreen: SplashScreen,
    ionicStorage: Storage,
    autenticacao: AutenticacaoProvider,
    firebase: AngularFireAuth,
    private ref: ChangeDetectorRef) {

    platform.ready().then(() => {


      ionicStorage.get('OnboardPage').then((OnboardPage) => {
        if (OnboardPage || OnboardPage != null || OnboardPage != undefined) {

          let unsubscribe = firebase.auth.onAuthStateChanged((user) => {
            if (!user) {
              this.rootPage = 'LoginPage';
            } else {
              console.log('logged', user)
              this.rootPage = 'TabsPage';

        else {
          this.rootPage = 'OnboardPage';


after resizing the window

Can someone help me please ? =/

See: Ionic phone authentication with firebase

Ionic 3 and Angularfire2 Auth sample code:

For example: