I created a sample chat application in which when a user logs in, the application will go to the tab page
<ion-tabs tabsPlacement="top" color="header" tabsHighlight=true>
<ion-tab [root]="tab1" tabTitle="Chats" tabIcon="chatbubbles"></ion-tab>
<ion-tab [root]="tab2" tabTitle="Groups" tabIcon="contacts"></ion-tab>
<ion-tab [root]="tab3" tabTitle="Profile" tabIcon="contact"></ion-tab>
</ion-tabs>

when I check the current active page on the tabs on console.log(this.navCtrl.getActive().name);, I get undefined. Could you tell me why?
When I go to a new page, click the app icon from the title this.navCtrl.push('FriendsPage');. On a new page, when I print the current name of the active page, the name of the previous page " ChatPage" instead of " FriendsPage" is
displayed
Edit: Added tilt action
this.platform.registerBackButtonAction(() => {
let activePortal = this.ionicApp._loadingPortal.getActive() ||
this.ionicApp._modalPortal.getActive() ||
this.ionicApp._toastPortal.getActive() ||
this.ionicApp._overlayPortal.getActive();
if (activePortal) {
activePortal.dismiss();
} else {
if (this.nav.canGoBack()) {
this.nav.pop();
} else {
if (this.nav.getActive().name === "LoginPage"||this.nav.getActive().name === "SignupPage") {
this.platform.exitApp();
}else {
this.generic.showAlertConfirm("Exit", "Do you want to exit the app?", this.onYesHandler, this.onNoHandler, "backPress");
}
}
}
})
In my case, when the user navigates to the Friends tab from the tabs and the hardware submarine is pressed. In a normal case, a view should appear. But I get a warning.
this.generic.showAlertConfirm("Exit", "Do you want to exit the app?", this.onYesHandler, this.onNoHandler, "backPress");
, .