Prevent hardware back button click when loading controller is showing


I am using a loading controller during a http call. In android when I press hardware back button the page navigates back but loading controller is still displayed. What I want to disable hardware back button when loading controller is displaying.

Ionic info;
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.10.2
Xcode version: Xcode 8.3.1 Build version 8E1000a

1 Like

i have the same issue let me know when you find the solution. thanks :slight_smile:

Not a good solution but I register back button action before calling any http call using registerBackButtonAction function & deregister it in http response or error.

    this.unregBackCall = this.platform.registerBackButtonAction(() => {

    }, 100);

    this.unregBackCall && this.unregBackCall();

Ionic team should add disabling back button action while loading controller is showing.