Native.keyboardshow & hide not working on phone

In the project I am currently working, I have this footer:

<body ng-app="bitcharts">
   <ion-pane ng-controller="calcController as calc" ng-cloak>
      <div class="bar bar-footer" ng-show="calc.showFooter">
         <div class="title">
            *text*
         </div>
      </div>
   </ion-pane>
</body>

And this Angular’s script:

angular.module('bitcharts', ['ionic'])
.controller('calcController', function($http, $filter) {
   var vm = this;

   vm.showFooter = true;

   window.addEventListener('native.keyboardshow', function(){
      vm.showFooter = false;
   });

   window.addEventListener('native.keyboardhide', function(){
      vm.showFooter = true;
   });
});

When I run the app on Ionic View, the script works perfectly.
But then, I build and install the app on my phone, and the script stops working.
Any ideas why?

N.