How to hide app content on the app switcher in Ionic 5?

I’m using Ionic 5.

I would like to hide the app content (e.g. make the app content blank or splashscreen) on the app switcher to protect privacy.

I tried this:

    this.platform.ready().then(
      () => {
        this.platform.pause.subscribe(
          () => {
            this.splashScreen.show();
          }
        );
        this.platform.resume.subscribe(
          () => {
            this.splashScreen.hide();
          }
        );
      }
    );

But nothing gonna happen because the pause event is triggered too late. What should be the solution for this purpose? Thank you.

Hi - did you solve this? I have a similar(ish) requirement

Not yet.:sweat_smile::bowing_man:t2: Sorry bro

I got round my particular issue by using

await SplashScreen.show({
        autoHide: false,
});

on the pause event and then

setTimeout(() => {
        SplashScreen.hide();
 }, 1500);

on resume.

Let me try later. Thanks.