i don’t know what you exactly want but in my app this code work perfactly with linear navigation…
add this in constructor
private app: App
platform.registerBackButtonAction(() => {
const overlayView = this.app._appRoot._overlayPortal._views[0];
if (overlayView && overlayView.dismiss) {
overlayView.dismiss();
return;
}
if (this.nav.canGoBack()) {
this.nav.pop();
}
else {
let view = this.nav.getActive();
if (view.component == DashboardPage || view.component == LoginPage) {
if (this.alert) {
this.alert.dismiss();
this.alert = null;
} else {
this.platform.exitApp();
//this.showAlert();
}
}
}
});