App level lifecyclce hook not page level


#1

I want something like android lifecycle in ionic. Is there any method in ionic at app level like android onStop or onDestroy method.


#2

Closest would probably be the pause event of Platform.


#3

What about OnDestroy when implemented by your AppComponent:

export class AppComponent implements OnInit, OnDestroy {

  ...

  public ngOnDestroy() {

  }

}

See: https://angular.io/guide/lifecycle-hooks#other-angular-lifecycle-hooks