Add eventListener to 'native.keyboardshow' but nothing happens

@cristiano_ciuti Cristiano Ciuti
Sun, 10 Jul 2016 09:03:33 +0000
ionic 2

@cristiano_ciuti wrote:

I'm trying to use 'native.keyboardshow' event to calculate the keyboard height of software keyboard but the event 'native.keyboardshow' is never fired.
What am i missing?

this.keyboardshowObservable = Observable.fromEvent(window, 'native.keyboardshow');
this.keyboardhideObservable = Observable.fromEvent(window, 'native.keyboardhide');
this.keyboardshowObservable.subscribe(data => {
console.log("OK");
});
this.keyboardhideObservable.subscribe(data => {
console.log("OK");
});

EDIT: I tried also
window.addEventListener('native.keyboardshow', () => {
console.log("keyboard show");
});
without success

EDIT 2: I can see in the console:
warn Native: tried calling Keyboard.disableScroll, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
I'm using 'ionic serve' and open url on my iphone. I have "cordova.js" script included in my index.html.
What's the problem?
Maybe keyboard native plugin doesn' work on browser?