[Solved] Show splashscreen on "pause" cordova event


#1

Hello,

Is it possible with Ionic to display the splashscreen again any time after the app is loaded and running?

Thanks


#2

Yep, you can use the cordova splashscreen plugin and show/hide the splash screen as much as you want.

http://ngcordova.com/docs/plugins/splashscreen/


#3

Cool, thanks for that. Now more specifically:

The reason I want to do that is because, when sending an app to the background, Android and iOS both take a screenshot of the state of the app. Problem is my app may display sensible information and I want to make sure they are not captured on those screenshots and stored temporarily somewhere on the device. That’s why I want to display the splashscreen on a “pause” cordova event and hide it again on “resume” event.

Problem is, when I try, the screenshot still shows the app’s last page and not the splashscreen, and I guess it’s because the screenshot is somehow taken by the system just before the execution of the function called at “pause” event.

Any idea on how to sort this out?


#4

Hmm, well there are a few things you could do.

you could use the cordova pause event to show the splashscreen

$ionicPlatform.on('pause', function(){
  navigator.splashscreen.show();
})

Or you could take a look at this plugin

Which was build for the exact purpose you have. My vote is for the plugin.


#5

That plug’in seems to be exactly what I was looking for. Cheers!


#6

It did the job indeed. Thank you so much Mike. :slight_smile:


#7

the plugin will disallow users to take screenshot manually as well.
Can i achieve this using pause/resume events?