Splash screen flickering on .hide()

I’m having the following issue:

  • When launching the app, the splash screen appears. When the SplashScreen.hide(); is called the splash screen flickers and hides.

I need a solid solution for this fix, there are many comments on the internet that suggests using a setTimeout(), that won’t work for me because I can’t trust on a fixed time.

The code I’m using is pretty simple and straight forwards:

//Side info
import { Plugins } from '@capacitor/core';
const { SplashScreen } = Plugins;

//Using the Ionic InAppBrowser
constructor ( private iab: InAppBrowser)

ngOnInit() {
  this.platform.ready().then () => {
    const browser = this.iab.create('https://google.com', '_blank');
    browser.on('loadstop').subscribe( event => { SplashScreen.hide(); });
  });
}

Changing the SplashScreenDelay value has no effect, if anyone needs more information please let me know!

Side info:
I just discovered that the InAppBrowser closes my SplashScreen on it’s own.

First: I don’t know, i’m just guessing.

If People say use a setTimeout, have you tried:

this.platform.ready().then () => {
    const browser = this.iab.create('https://google.com', '_blank');
    browser.on('loadstop').subscribe( event => { 
       setTimeout(() => {
          SplashScreen.hide();
          }, 10);
    });
  });

Just as a Test, give it a Try.

Hi thanks for your reply, I tried your solution. Sadly it didn’t work, the first time I started the APK I saw a white screen for 2s, the second time I had the same flickering issue.