Hardware Back Button Not Working on Android

I have read through the documentation and it says that out of the box Ionic supports the android hardware back button. That it will pop off the stack etc.

My application is angualr 12.2.4 with ionic/angular 5.8.1 and capacitor/core 3.2.3 Originally the back button on android would just close the application. After reading some I saw that the back button was handled with capacitor/app so I have installed 1.1.1. This now prevents the back button from closing the application, however, nothing happens now.

Reading the Ionic docs about the hardware back button i tried to use the Basic Usage by adding the following to my app.component.ts

constructor(private platform: Platform) {
  this.platform.backButton.subscribeWithPriority(10, () => {
    console.log('Handler was called!');

however, the console log was never called. I saw a recommendation to use the following

App.addListener('backButton', () => {

      console.log('back button pressed');




and this console log is being called. Next issue i have is that nothing is happening. Modules are not popping. Its there something i need to do in order to activate this functionality?

Same issue here. Using the hardware back button on Android doesn’t do anything.


    "@angular/common": "^14.0.0",
    "@angular/core": "^14.0.0",
    "@angular/forms": "^14.0.0",
    "@angular/platform-browser": "^14.0.0",
    "@angular/platform-browser-dynamic": "^14.0.0",
    "@angular/router": "^14.0.0",
    "@capacitor/android": "4.3.0",
    "@capacitor/app": "^4.0.0",
    "@capacitor/assets": "^1.0.0-next.5",
    "@capacitor/core": "^4.2.0",
    "@capacitor/haptics": "^4.0.0",
    "@capacitor/keyboard": "^4.0.0",
    "@capacitor/status-bar": "^4.0.0",
    "@ionic/angular": "^6.1.9",
    "luxon": "^2.3.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"