Ionic 2 App Re-Display page on start-up


Does anyone know how I could either a) force my app to re-start from scratch every time the user launches the app or b) re-display a particular page when the app re-starts e.g on resume.

I have a tabbed Ionic 2 application with a login page which I display on start-up, and then when the user logs in my TabsPage is pushed onto the nav. I want to get that initial login page to display every time the user opens the app, rather than have the application open up with the tabs already open.

In my app.js I have:

class MyApp {
constructor(platform: Platform) {
this.root = LoginCtrl;

platform.ready().then(() => {


bindEvents: function () {
document.addEventListener(‘resume’, this.onResume, false);

onResume: function () {
console.log(“on resume”);
this.root = LoginCtrl;


This doesn’t work i.e the LoginPage is not re-displayed although the onResume event is firing.

What would I need to do to get that to work?


Your app.html should have something like

<ion-nav id="nav" [root]="rootPage" #content swipe-back-enabled="false"></ion-nav>

then if you set rootPage to something useful in your app.js, that’s the first place the app will go when you initialize it.

this.rootPage = LoginPage;

Does that work for you?

Cordova on resume and native plugins

@richardshergold Did you figure out how to do this? I need to do this as well.


I can’t remember to be honest. I think possibly not.


This worked for me:

      // Listen for the app coming from the background into the foreground
      document.addEventListener('resume', () => {
        setTimeout(() => {


You can also use the Platform API form Ionic:

this.platform.resume.subscribe(e => {