Override Back Buton : the code is good but not activated at first start

Hi All,

I creaded an application and I want to override the backbutton.
This code works but it is not actived when user start application.
User needs press “burger menu” one time to active the following code.
Can i have help, please ?

.run(function($ionicPlatform,$rootScope,$ionicSideMenuDelegate, $state, $window) {

      // Disable BACK button on home

      //alert('registerBackButtonAction !!!');
      $ionicPlatform.registerBackButtonAction(function (event) {
          if(($state.current.name!="app.winesDetail") && ($state.current.name!="app.ficheDetail")){
          } else {
          return false;
      }, 101);



No idea ? :cry: :sob: