无法使用PhoneGap Build覆盖首选项(生成的config.xml中的顺序错误) [英] Can't override preference using PhoneGap Build (order in generated config.xml is wrong)

查看:109
本文介绍了无法使用PhoneGap Build覆盖首选项(生成的config.xml中的顺序错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用cordova-plugin-statusbar来定制我的应用程序状态栏在iOS上的外观.具体来说,我想将StatusBarOverlaysWebView的值更改为false,因此在我的config.xml中包括以下行:

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" />

当我使用本地XCode构建进行测试时,这非常有用.但是,当我在PhoneGap Build上构建时,此值的默认设置(true)不会被覆盖.

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.

经过大量的抓挠之后,我注意到config.xml中的首选项顺序与PhoneGap生成的首选项顺序不同.在我的本地版本中,该插件的plugin.xml中的以下行包含在之前该行覆盖该设置:

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" />

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

但是,在PhoneGap生成的config.xml中,这些行出现在文件的最后.我猜测最后写入将获胜",因此默认值将覆盖我的自定义首选项.

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.

我是否可以通过某种方式影响这一点?还是仅仅是PhoneGap Build的错误?

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

推荐答案

@Matthew,
好的.感谢您加载config.xml.我看过了我不确定您是否需要NSAppTransportSecurity的扩展名.暂时将它们取出,但要保存以防万一.

@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.

  • versions of the latest plugins with new spelling; make sure to source=npm
  • Plugins Release: June 22, 2015
  • 以下博客文章纠正了有关白名单,插件和CSP的误解和错误信息.雷蒙德承认犯了错误,幸运的是人们可能没有犯过这些错误.我几乎可以肯定你还没有.
  • 有关Cordova 5的重要信息

此外,请阅读包含插件的文档(在顶部附近) ,而不仅仅是 白名单指南 .

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

您可能需要添加:

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

让我知道如何进行.哦,让我看看您的最终config.xml. TIA

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

这篇关于无法使用PhoneGap Build覆盖首选项(生成的config.xml中的顺序错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆