Phonegap: config.xml update request

0 favourites
  • 4 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • I've spent the last few days playing around with Phonegap Build. VERY exciting, I can tell you.

    However, I think that it's come a long way over the last few months from when I last played with it and it's now quite a viable option for porting simple apps to iOS and android. Although I don't think it will ever compete with Crosswalk for running physics based games (not ever?) it is still pretty good for simple puzzles etc (and it's < 17 Mb, no flickering splash screen, loads in 2 sec...). Anyhow, enough of this: I have some Phonegap export requests to make and I hope Ashley might be able to include them in a future build just to make life a bit easier.

    Please could the Phonegap build process add the following lines of code to the config.xml file (commented out if need be, but having it there would save hours of internet searching for the non-coders among us):

    To control which Build version to use, add:

    <font color=blue><preference name="phonegap-version" value="3.3.0" /></font>

    Although the version number included will become legacy I'm sure, by stipulating a build version you can ensure that you have control over which is used. I found that without this the Build sometimes regressed to using 3.1.0 (a couple of others on the forum have had similar problems). No 'biggie', but it was irritating.

    To hide the status bar on iOS 7, add:

    <font color=blue><!-- Hide Status Bar iOS -->

    <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">



    <gap:config-file platform="ios" parent="UIStatusBarHidden" overwrite="true">



    The above code works a treat, the old "<preference name="fullscreen" value="true" />" no longer works on the latest gift from Apple. From what I understand, build >3.0.0 has this problem but the above code sorts it out.

    To manage the splash screen on iOS, add the following:

    <font color=blue><!-- Do not auto hide splash on iOS -->

    <preference name="AutoHideSplashScreen" value="false" />

    <!-- Do not auto hide splash on Android -->

    <preference name="SplashScreenDelay" value="10000"/>

    <gap:plugin name="org.apache.cordova.splashscreen" /></font>

    Some users (including myself) encountered white screens after the splash screen on iOS. The above code allows the splash screen auto-hide to be over-ridden, which ensures that there's not a blank canvas for 1/2 sec or so until the first layout loads.

    For android builds, inside the widget at the top of the config.xml add:

    <font color=blue><widget ......

         versionCode = "xxxx"


    Where the versionCode xxxx is the numerical identifier used by android/google for app version identification. Control over this number is important if you're going to have a successful app load onto Google Play and Phonegap will insert the number into the Manifest file during the build. I think omission results in a default 1 and is a pain to fix if you need to upgrade your apk. The details could be added to the popup settings window prior to export.

    There's loads more available on the Phonegap website but I thought that these changes would be really helpful and keep C2 up to speed with other non-of-the-moment 3rd party wrappers.

    Enough from me, I hope this is supported - thanks!

  • My one and only bump, becaue there have been a lot of new topics recently...

  • Woah, this is really really useful, thanks for sharing! Hope ashley can do this on next update.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You should be able to use the Intel XDK as an alternative to phonegap build. In addition to crosswalk in XDK build tab, you can select ios & android. You will be using standard phonegap/cordova so you will get the small apk. It doesn't read the config.xml, but the project settings in Intel XDK will let you specify full screen, version codes, etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)