Ionic 5 - Disabling hardware back button Android

Hello!
I’ve already looked for it in the forum without any luck.

Has any of you been able to find a way for disabling the hardware back button or to link other events to it?

With Ionic 3 it worked like a charm but with Ionic 5 (and even Ionic 4) i’m not able to lock it.

Thanks!

You can subscribe to the BackButton like:

 this.platform.backButton.subscribeWithPriority(priority, () => {
 // do on back button click
});

Information about the Priority Handling can be found here.

Just doing nothing inside will kinda disable it.