registerBackButtonAction doesn't work


#1

registerBackButtonAction doesn’t work.
I executed the following code, but when I press the hardware back button, nothing is displayed in the log.
What should I do?

import { Platform } from 'ionic-angular';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage = TabsPage;

  constructor(platform: Platform) {
    platform.registerBackButtonAction(() => {

          console.log("Backbutton pressed.");

      }, 100);

    });
  }
}

#2

Wrap that in
this.platform.ready().then(() => )


#3

Thank you for reply.

I tried it but doesn’t work.


#4

For me also this dont work with ionic Pro, any updates ?