Hiding Splash Screen

Hello,

I’m only testing against Android at present, but I have a splash screen working well now. It is currently just configured in my config.xml as

  <preference name="SplashScreen" value="screen" />
  <preference name="SplashScreenDelay" value="10000" />

This shows it for ten seconds. I wish to hide it when my app starts, after lots of googling I found

// Hide the splash screen as soon as the device is ready
    if (window.navigator && window.navigator.splashscreen) {
        console.log('Hiding splash screen');
        window.navigator.splashscreen.hide();
    }

The trouble is, window.navigator.splashscreen is never true, and so splashscreen.hide is never called.

Can anyone recommend a good way to do this please?

Thanks for your time, Russ

window.navigator.splashscreen is a plugin, install it with

ionic plugin add org.apache.cordova.splashscreen

to have control over the splashscreen in your app.

To not allow to auto hide the splashscreen in android, you also have to add the following to your config.xml:

<preference name="AutoHideSplashScreen" value="false" />

I was missing the plugin, silly mistake. Thank you :smile:

1 Like

Hello! why my splash screen not dismiss with window.navigator.splashscreen.hide()?

Hey this helped me!