【发布时间】:2016-08-22 18:45:46
【问题描述】:
我正在努力将较旧的应用程序更新为较新版本的 phonegap api。我正在努力让网络访问工作。
我已更改 config.xml 以删除功能块并添加了插件 cordova-plugin-whitelist。我还在 config.xml 文件中添加了以下内容。
<access origin="*"/>
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
我还在索引文件中添加了内容安全元标记。
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline'; media-src *">
网络检查报告“未知”。
var networkState = navigator.connection.type;
alert('Connection type: ' + networkState);
我还注意到应用权限没有列出网络访问权限。
有人知道什么会导致这种情况吗?
【问题讨论】:
-
在您的 AndroidMainfest.xml 中添加以下行权限:
标签: android cordova phonegap-build