My Hardware 'Back Button Action' is not working in Ionic 4
问题 I am working in my Ionic 4 app and When the user clicks 2 times on the mobile back button, then it should close the app but this is not happening. This is my app.component.ts : lastTimeBackPress = 0; timePeriodToExit = 2000; @ViewChildren(IonRouterOutlet) routerOutlets: QueryList<IonRouterOutlet>; constructor(){ this.backButtonEvent(); } backButtonEvent() { document.addEventListener("backbutton", () => { this.routerOutlets.forEach((outlet: IonRouterOutlet) => { if (outlet && outlet.canGoBack(