this.platform.registerBackButtonAction doesn’t work until we tap on screen

Hi,

registerBackButtonAction function is not working until i tap on screen once. I opened ionic app and press android back button then registerBackButtonAction doesn’t work but when i tap on screen and press android back button then registerBackButtonAction is working fine. Any idea why this is happening?

Very hard to say anything without seeing any code, but I’ll throw $5 on “forgetting to wait until the platform is ready before trying to interact with it”.

I have the same problem and the code is simple, first line of app.component.ts inside the constructor

    platform.registerBackButtonAction(() => {
      alert('back');
    });