How to properly use Hardware back button

I’m so desperately looking for an answer for this, please help.
I have three ionic pages, structure as follows


And each pages has hardware back button listener inside the constructor function,
in new & old pages it simply change route back to home page,

this.platform.backButton.subscribeWithPriority(10, () => {


this.platform.backButton.subscribeWithPriority(10, () => {
  if (!this.routerOutlet.canGoBack()) {

But my problem is when i put press back button on home page it doesn’t work but other two functions ( both new & old pages)working properly,

So then i put console.log inside every back button listener and once the app is on home page and once the back button is pressed it keeps calls the last visited page back button listener.

Any idea on what’s wrong here ?

1 Like