Search code examples
cordovakeyboardionic-frameworkblackberry-10

ionic-plugin-keyboard show/hide events not working on blackberry10


I want to use the ionic-plugin-keyboard plugin on my blackberry10 platform target. I had to figure out that nothing happens in respect to the event listener below.

window.addEventListener('native.keyboardshow', keyboardShowHandler);
window.addEventListener('native.keyboardhide', keyboardHideHandler);

function keyboardShowHandler(e){
    alert('Keyboard height is: ' + e.keyboardHeight);
}

function keyboardHideHandler(e){
    alert('Goodnight, sweet prince');
}

The event listener are never called as well as the implemented alerts...


Solution

  • While debugging the code with Web Inspector I found out, that the related blackberry10 plugin code is missing in my blackberry10 mobile application. I am assuming that the corresponding code gets never parsed into the blackberry10 platform target from cordova.

    As a possible workaround I am using these events now, which I have found on the WebWorks 2.2 documentation on the blackberry developer page (show / hide):

    document.addEventListener( "keyboardOpened", keyboardShowHandler );
    document.addEventListener( "keyboardClosed", keyboardHideHandler );
    

    These events are available by adding the com.blackberry.app plugin to the cordova project:

    cordova plugin add com.blackberry.app