Search code examples
ioscordovaphonegap-pluginsphonegap-buildstatusbar

Can't override preference using PhoneGap Build (order in generated config.xml is wrong)


I am using cordova-plugin-statusbar to customize the appearance of my app's statusbar on iOS. Specifically, I want to change the value of StatusBarOverlaysWebView to false, so I include the following line in my config.xml:

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

This works great when I test using a local XCode build. When I build on PhoneGap Build, however, the default setting for this value (which is true) is not overridden.

After considerable head-scratching, I noticed that the order of the preferences in config.xml is different in the one generated by PhoneGap. In my local build, the following lines from the plugin's plugin.xml are included before the line overriding the setting:

<feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" /> <param name="onload" value="true" /> </feature> <preference name="StatusBarOverlaysWebView" value="true" />

In the config.xml generated by PhoneGap, however, these lines appear at the very end of the file. I am guessing that "last write wins" and thus the default value is overwriting my custom preference.

Is there some way for me to influence this or is it just a PhoneGap Build bug?


Solution

  • @Matthew,
    Okay. Thanks for loading your config.xml. I did read it. I'm not sure you need the extension for NSAppTransportSecurity. Take them out for now, but save them, just in case.

    Here is some more stuff to help clarify.

    plugins

    white-list

    • The following blog post corrects misconceptions and misinformation about the white-list, the plugin and CSP. Raymond confesses to making mistake, luckily not may people have made those mistakes. I'm almost sure you have not.
    • Important information about Cordova 5

    In addition, read the documentation with the plugin (near the top), and not just the white-list guide.

    You may need to add:

    • <allow-navigation (..)>
    • <allow-intent (..)>

    Let me know how it goes. Ohh, and let me see your final config.xml. TIA