【发布时间】:2016-04-20 00:01:38
【问题描述】:
我有一个 PhoneGap 应用程序,我正在使用 AngularJS。我正在对我的 Node 后端使用一个非常简单的 $http 调用:
$http.get("http://localhost:6969/random")
.then(function(response) {
$scope.images = response.data;
});
无论如何,PhoneGap 永远不会打到后端。我已经在普通浏览器中测试过,它可以正常工作。
我显然已经阅读了很多关于它的内容,大多数人使用白名单来修复它,但在我的 config.xml 中,我的白名单几乎是尽可能开放的:
<plugin name="cordova-plugin-whitelist" source="npm" spec="1.1.0" />
<allow-navigation href="*" subdomains="true" />
<allow-intent href="*" subdomains="true"/>
<access origin="*" subdomains="true"/> <!-- Required for iOS9 -->
我需要改变什么?断断续续地与这个错误作斗争了几天,在我的空闲时间无法真正创建新的酷功能有点烦人。
编辑:我正在使用 phonegap serve 为应用提供服务,并使用 PhoneGap 开发者应用对其进行测试。
【问题讨论】:
-
你安装了白名单插件吗? cordova plugin -l 返回什么?
-
是的,我只是尝试重新安装它以确保它显示
client git:(master) ✗ cordova plugin add cordova-plugin-whitelist Plugin "cordova-plugin-whitelist" already installed on android. Plugin "cordova-plugin-whitelist" already installed on browser. -
对不起@user1027620 这里是
cordova plugin -l的输出:cordova-plugin-whitelist 1.2.2-dev "Whitelist" -
@user1027620 为清楚起见,在帖子底部添加了更多信息
-
这个问题只影响安卓吗?
标签: angularjs cordova phonegap-cli