PhoneGap构建外部URL不会仅在iOS中为cli-5.2.0加载

时间:2015-11-12 16:28:59

标签: ios cordova phonegap-plugins phonegap-build whitelist

以下是我的PhonegapBuild config.xml的副本 出于某种原因,该应用程序在Android上运行良好,并且在iOS上无法正常运行 没有外部内容加载 当我启用调试时,它不会显示在WEINRE上 我已多次检查我的配置,并且不认为我遗漏了任何东西 但显然我是。

我在这里缺少什么?

帮助表示赞赏

<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns   = "http://www.w3.org/ns/widgets"
    xmlns:gap   = "http://phonegap.com/ns/1.0"
    id          = "com.abcxyz.xxxyyy"
    versionCode = "600001" 
    version     = "6.0.1" >

<!-- 
ANDROID
id          = "com.abcxyz.xxxyyy"

iOS
id          = "com.abcxyz.xxxyyy"


versionCode is optional and Android only 
-->

<name>xxx yyy</name>

<description>
    Track your yyyditioning process using this tool.
</description>

<author href="http://xxxyyy.com" email="support@xxxyyy.com">
    xxxyyy.Com
</author>
<preference name="LoadingPageDialog" value="xxx yyy"/>

<preference name="phonegap-version" value="cli-5.2.0" />


<!-- DEFAULT ICON (ALWAYS ON ROOT DIRECTORY) -->
<icon src="icon.png" />

<icon src="icons/ios/icon.png" gap:platform="ios" width="57" height="57" />
<icon src="icons/ios/icon-72.png" gap:platform="ios" width="72" height="72" />
<icon src="icons/ios/icon-at-2x.png" gap:platform="ios" width="114" height="114" />
<icon src="icons/ios/icon-at-76x76.png" gap:platform="ios" width="76" height="76" />
<icon src="icons/ios/icon-at-120x120.png" gap:platform="ios" width="120" height="120" />
<icon src="icons/ios/icon-at-152x152.png" gap:platform="ios" width="152" height="152" />
<icon src="icons/ios/icon-at-156x156.png" gap:platform="ios" width="156" height="156" />
<!-- retina iPad support: PhoneGap 2.5.0+ only -->
<icon src="icons/ios/icon-72-at-2x.png" gap:platform="ios" width="144" height="144" />

<icon src="icons/android/ldpi.png" gap:platform="android" gap:density="ldpi" />
<icon src="icons/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
<icon src="icons/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
<icon src="icons/android/xhdpi.png" gap:platform="android" gap:density="xhdpi" />

<icon src="icons/winphone/icon.png" gap:platform="winphone" />
<icon src="icons/winphone/icon-173-tile.png" gap:platform="winphone" gap:role="background" />


<gap:splash gap:density="ldpi" gap:platform="android" src="splash/android/ldpi.png" />
<gap:splash gap:density="mdpi" gap:platform="android" src="splash/android/mdpi.png" />
<gap:splash gap:density="hdpi" gap:platform="android" src="splash/android/hdpi.png" />
<gap:splash gap:density="xhdpi" gap:platform="android" src="splash/android/xhdpi.png" />
<gap:splash gap:platform="ios" src="splash/ios/screen-iphone-portrait.png" width="320" height="480" />
<gap:splash gap:platform="ios" src="splash/ios/screen-iphone-portrait-2x.png" width="640" height="960" />
<gap:splash gap:platform="ios" src="splash/ios/screen-iphone5.png" width="640" height="1136" />
<gap:splash gap:platform="ios" src="splash/ios/screen-ipad-portrait.png" width="768" height="1024" />
<gap:splash gap:platform="ios" src="splash/ios/screen-ipad-landscape.png" width="1024" height="768" />
<gap:splash gap:platform="ios" src="splash/ios/screen-ipad-retina-portrait.png" width="2048" height="1496" />
<gap:splash gap:platform="ios" src="splash/ios/screen-ipad-retina-landscape.png" width="1536" height="2048" />
<gap:splash gap:platform="winphone" src="icons/winphone/icon.png" />


<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="0" />

<preference name="orientation" value="portrait" />
<preference name="webviewbounce" value="false"/>
<preference name="prerendered-icon" value="true" />
<preference name="ios-statusbarstyle" value="black-translucent" />
<preference name="fullscreen" value="true" />
<preference name="stay-in-webview" value="true" />


<!--
<icon src="icon.png"/>
<gap:splash src="assets/images/template/startup_landscape.jpg" height="768" width="1024" gap:platform="ios"/>
<gap:splash src="assets/images/template/startup_portrait.jpg" height="1024" width="768" gap:platform="ios"/>
-->

<gap:plugin name="org.apache.cordova.dialogs" source="npm" />
<gap:plugin name="org.apache.cordova.vibration" source="npm" />
<gap:plugin name="org.apache.cordova.device" source="npm" />
<gap:plugin name="org.apache.cordova.splashscreen" source="npm" />
<gap:plugin name="org.apache.cordova.network-information" source="npm" />
<gap:plugin name="org.apache.cordova.file-transfer" source="npm" />
<gap:plugin name="org.apache.cordova.camera" source="npm" />
<gap:plugin name="org.apache.cordova.file" source="npm" />
<gap:plugin name="org.apache.cordova.media-capture" source="npm" />
<gap:plugin name="org.apache.cordova.console" source="npm" />
<gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.1.0" />

<gap:plugin name="org.madmobile.cordovaplugins.zbarscanner" source="npm" />

<!--
<gap:plugin name="org.madmobile.cordovaplugins.zbar" />

<gap:plugin name="com.phonegap.plugins.barcodescanner" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="com.phonegap.plugins.pushplugin" />
-->


<!--
<access origin="crictopia.com" subdomains="true" browserOnly="false" />
<access origin="*" />
<access origin="http://app.xxxyyy.com" subdomains="true" />
<access origin="http://app.abcxyz.com" subdomains="true" />
<access origin="http://google.com" subdomains="true" />
<access origin="https://secure.xxxyyy.com" subdomains="true" />
-->
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

<allow-navigation href="http://*/*" />

1 个答案:

答案 0 :(得分:0)

事实证明,实际上并不是config.xml是问题

问题是index.html安全设置适用于Android而不是iOS

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'" >

简单地删除了整个标签,生活很美好