Show Splash when resuming from background?


#1

Hi all,

Tried digging through these forums and elsewhere for an answer, but haven’t found an answer. Is it possible to show the splash screen whenever the app is resumed from background?

I’ve added the following to my home.ts as an attempt:

import { Component } from '@angular/core';
import { NavController, Platform  } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
	public tap: number = 3;
	

	constructor(
		public navCtrl: NavController, 
		public splashScreen: SplashScreen,
		public platform: Platform) 
		{
			platform.ready().then(() => {    
		        this.platform.pause.subscribe(() => {
		            console.log('App paused');
		        });
		
		        this.platform.resume.subscribe(() => {
		            console.log('App resumed');
		            this.splashScreen.show();
		            
		        });
			});
		}
}
	
	

Seeing the App paused and resumed in the logs but the splash doesn’t show when I exit and return to the app. Suggestions?


#2

So it does [quote=“Arains, post:1, topic:88805”]
console.log(‘App resumed’);
[/quote]

like it should but it doesn’t[quote=“Arains, post:1, topic:88805”]
this.splashScreen.show();
[/quote]

?


#3

Yes, I see “App resumed” but no occurrence of the splash. Splash does show on initial load as desired, just not on resume.