Splashscreen logic

Hello,

I would like to know where I can add any code that needs to be run before running any page.
I would like the splash screen to stay visible until this code is run, as this code mean that the application is now ready to be used and that the first page can actually been rendered.

Thank you for your help and great work.

1 Like

Maybe you could try this:

config.xml

<preference name="FadeSplashScreen" value="false"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="SplashScreenDelay" value="0"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="SplashReloadOnOrientationChange" value="true"/>

app.ts

import { StatusBar, Splashscreen } from 'ionic-native';

...

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();

      // YOUR CODE HERE...

      Splashscreen.hide();
    });
  }