我正在使用Ionic v1开发IOS应用程序。我在我的应用程序中添加了cordova-plugin-whitelist插件。它不允许我仅在IOS设备中使用http调用。它在Android和Ionic Serve中运行良好。实际上,它工作正常,但我不知道为什么它停止工作。我删除并重新安装了所有插件和IOS版本。这是我的config.xml文件。
<?xml version='1.0' encoding='utf-8'?> <widget id="com.xxx.xxx" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>xxx</name>
<author email="xxx" href="xxx">
xxx
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://*/*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="SplashScreenDelay" value="2000" />
<preference name="FadeSplashScreenDuration" value="2000" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<preference name="android-targetSdkVersion" value="23" />
<platform name="ios">
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120"/>
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100"/>
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120"/>
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180"/>
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144"/>
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152"/>
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167"/>
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58"/>
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87"/>
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
</platform>
<plugin name="cordova-plugin-camera" spec="^2.4.1" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.2" />
<plugin name="cordova-plugin-network-information" spec="~1.3.4" />
<plugin name="cordova-media-with-compression" spec="~2.1.1" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="es6-promise-plugin" spec="~4.1.0" />
<plugin name="cordova-plugin-dialogs" spec="~1.3.4" />
<plugin name="cordova-plugin-image-picker" spec="~1.1.1" />
<plugin name="cordova-plugin-compat" spec="~1.2.0" />
<plugin name="cordova-plugin-device" spec="~1.1.7" /></widget>
这是我的package.json
{
"name": "",
"version": "1.1.1",
"description": "xxx",
"dependencies": {
"async": "^1.4.0",
"gulp": "^3.5.6",
"gulp-angular-templatecache": "^1.5.0",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4",
"gulp-sourcemaps": "^1.5.2",
"require-dir": "^0.3.0"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0",
"del": "^1.2.0",
"gulp-flatten": "^0.1.1",
"gulp-if": "^1.2.5",
"gulp-json-editor": "^2.2.1",
"gulp-minify-css": "^1.2.0",
"gulp-ng-annotate": "^1.1.0",
"gulp-ng-constant": "^0.3.0",
"gulp-preprocess": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-shell": "^0.4.2",
"gulp-uglify": "^1.2.0",
"gulp-useref": "^1.2.0",
"gulp-zip": "^3.0.2",
"jshint": "^2.8.0",
"minimist": "^1.1.2",
"mv": "^2.1.1"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard",
"cordova-plugin-image-picker",
"cordova-plugin-transport-security"
],
"cordovaPlatforms": [],
"cordova": {
"plugins": {
"cordova-plugin-inappbrowser": {},
"cordova-plugin-network-information": {},
"cordova-plugin-compat": {},
"cordova-plugin-camera": {},
"cordova-media-with-compression": {}
},
"platforms": []
}
}
此处还有我的Content-security-policy标记。
<meta http-equiv="Content-Security-Policy" content="img-src * 'self' https://scontent.xx.fbcdn.net data:; default-src * gap://ready file:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; object-src 'self' blob:; media-src 'self' blob:; style-src 'self' 'unsafe-inline' *">
答案 0 :(得分:0)
“cordova-plugin-file-transfer”和“cordova-plugin-file”插件之间存在冲突,当我修复版本冲突时,它又开始工作了。