Tips for Moving from PhoneGap Build 2.9 to 3.x
Mar 23, 2014 · Comments PhoneGapCordovaI’m in the process of upgrading Fitwatchr from PhoneGap Build version 2.9 to 3.3 (the latest available on the Build service as of March 2014). Here are some notes on potential “gotchas”:
Debugging, plugin, or random app issues: Occasionally when testing on a mobile device, you may experience odd issues like plugins not working when they worked previously, logging not displaying in the debug window, etc. When this happens, it’s best to start fresh with a new build: remove the app from the device, rebuild it, and start again.
ChildBrowser plugin:
- When referencing it in JavaScript, a capital ‘C’ is needed in the variable name. Use “ChildBrowser” instead of “childBrowser”.
- The “install” method is deprecated. No need to call this anymore from your onDeviceReady method.
The Dialogs plugin is needed if you’re using native alert messages (aka navigator.notification.alert). Additionally, the alert function now requires the callback function variable; it will fail without it:
Works: navigator.notification.alert('message here’, alertCallback);
No Longer Works: navigator.notification.alert('message here’);
Splash Screen issues still abound in version 3.3, as evidenced by the Build GitHub Issues page and forums. From my testing it appears as though splash element order matters in the config.xml file, from smallest to largest. It really shouldn’t, especially since the PG documentation for splash screens is incorrect. They currently show:
<gap:splash src=“splash/ios/2048X1496-LANDSCAPE.png” gap:platform=“ios” width=“2048” height=“1496” />
<gap:splash src=“splash/ios/1536X2008-PORTRAIT.png” gap:platform=“ios” width=“1536” height=“2008” />
When 2048x1496 is listed first, PG shows the Portrait image, even in Landscape view (on my iPad mini retina, at least. Not tested on other devices). The correct order should be:
<gap:splash src=“splash/ios/1536X2008-PORTRAIT.png” gap:platform=“ios” width=“1536” height=“2008” />
<gap:splash src=“splash/ios/2048X1496-LANDSCAPE.png” gap:platform=“ios” width=“2048” height=“1496” />
If you are also moving to PhoneGap Build 3.3 and can share other tips, please comment. Especially relating to plugins!