Hardware back button with Ionic 4

Thank you for the suggestion. i remember doing this on v1 but in v4 the back button doesn’t seem to work, at least for me. Not sure if an Ionic v4 issue, the cordova-plugin-ionic-webview (2.0.0) or cordova (6.4.0). Plus, besides pages I’m also using alerts and popovers (as customizable popups, modals didn’t work the way I wanted).

And the code you are suggeting works in v3 but not in v4 because the registerBackButtonActino was removed in favor of subscribing to an… observable (? i think).