Cordova Faq

October 9, 2015

Cordova: tips and tricks.


From a painful working experience with Cordova here some notes.

Problem with input focus:

  • First check you have ionic keyboard installed.
  • Put this in your config.xml.
  <preference name="KeyboardDisplayRequiresUserAction" value="false" />

RequireJS doesn't find my files, what I going to do!?:

  • Remember IOS filesystem is case sensitive.

HTML5 Audio API Doesn't work in IOS:

  • It works but they think is a "good idea" to wait for user interaction, if you want to reproduce audio the user needs to click some button.

Touch response is slow:

Screen is jumping:

  • if you leave this enabled you're looking for trouble, IOS even stop the Javascript execution until scroll has finish. so save yourself some problems and download ionic keyboard plugin and disable the native scroll.

Emulate it with IScroll:

  • Problem is you don't have control over the native scroll on IOS, so in hybrid apps where you need full control of the viewport the best bet is to emulate it and then disabling the default scrolling as was described before.
  • iscroll
   var iscroll = new IScroll('.content');
  • if you are adding nodes to the DOM dynamicaly you need to tell IScroll to update the geometry using the refresh() method.
  • beware of the padding in the divs, for some reason the whole div doesn't report the right height.

Whitelisting network resource.

  • This plugin implements a whitelist policy for navigating the application webview on Cordova 4.0. Whitelisting.


comments powered by Disqus