How to do some action before exiting app ionic2


#1

How to do some action before exiting app in ionic2…

please help me out for this action


#2

Put this lines in the page(s) you want to control for exit:

import { Platform } from 'ionic-angular';

and in its/their costructor:

  this.platform.registerBackButtonAction(() => {
    this.exit(this.platform)
  });

the function exit will do something before exit:

exit(piattaforma) {
     blah bla blah
     piattaforma.exitApp();  
}

Have a good job!

P.


#3

Thank you… Its working fine…