I am facing problem with the hardware back button on android. I am working with Ionic CLI 4.12.0 I want to exit the app when user on homePage and clicks back button. But back button event is not firing up. It navigate to login page then restarts the app. I am using Tabs template in my app. I have tried many answers of stackoverflow that claims solution to the similar problem. I have setup code in app component as following:
@ViewChild(IonRouterOutlet) routerOutlet: IonRouterOutlet;
constructor(private platform: Platform){
this.platform.backButton.subscribeWithPriority(0, () => {
console.log("back button clicked");
navigator["app"].exitApp();
})
}
navCtrl.back()
afterwards. Maybe that helps? – Sinan Samet