registerBackButtonAction default action

It looks like there’s a solution to this:

Taken from: Android hardware back button in ionic

var unregister = this.platform.registerBackButtonAction(() => {
    console.log('OK');
    unregister();
});

I have successfully tested it in my phone (Nexus 5).