Search code examples
androidcordovaionic-frameworktaco

How to set platform version specific settings in Cordova?


It is desired that my application functions properly across a wide variety of platforms. In this case, my cordova app has a keyboard pop up on input focus. iOS, Android and even Windows Phone actually scroll to that input.

However, Android 4.2.x (and likely below) do not. I managed to fix this by setting

<preference name="Fullscreen" value="True" />

to

<preference name="Fullscreen" value="False" />

in my config.xml. Now, this means that the OS bar will be on the top of my app but I do not want this for any version of android except for android 4.2.x. Is there any way to specify this in the config.xml? If there is, it is not documented in Cordova 5.1.1. (https://cordova.apache.org/docs/en/5.1.1/config_ref/index.html)

It may be worth noting that I use TACO and Ionic.

Edit:

Further testing with the StatusBar plugin, the problem persists telling the application to run in fullscreen="false" and hiding the statusbar with the statusbar plugin.

So that means that the input focusing is related somehow to showing or not showing the statusbar. I am thinking this may be an android or cordova specific bug?


Solution

  • <preference name="Fullscreen" value="False" /> would appear to be the only way to solve this on Android 4.2.