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?