错误:在Phonegap中的白名单拒绝 [英] Error: Whitelist rejection in Phonegap
问题描述
我是移动开发的新手。我使用Phonegap / Cordova创建一个跨平台的应用程序。我的代码在Android上运行良好,但是当我把它移植到iPhone它显示一个错误:
I'm new to mobile development. I'm using Phonegap/Cordova to create a cross-platform app. My code works well on Android but when I'm porting it to iPhone it's showing an error:
[143:2003] ERROR whitelist rejection: url="abc"
现在我可以解决这个问题吗?
Now can I overcome this problem?
推荐答案
注意:此答案仅适用于PhoneGap版本1.x及以下。从2.x版本起,白名单配置通过
cordova.xml
完成。
Notice: This answer only applies for PhoneGap version 1.x and below. From version 2.x onwards, whitelist configuration is done via
cordova.xml
.
您必须将允许的URL添加到PhoneGap.plist(或Cordova.plist)ExternalHosts数组。
You have to add allowed URLs into PhoneGap.plist's (or Cordova.plist) ExternalHosts array.
例如,如果您要允许访问此URL < c $ c> http://www.myhost.com/path/file ,然后将 www.myhost.com
添加为新条目 ExternalHosts
数组。
For example, if you want to allow access to this URL http://www.myhost.com/path/file
, then add www.myhost.com
as a new entry to ExternalHosts
array.
如果您要允许访问Google所有子域的内容$ c> maps.google.com , mails.google.com
),您可以添加 *。google.com c>作为
ExternalHosts
数组的新条目。
If you want to allow access to content on all the subdomain of Google (e.g. maps.google.com
, mails.google.com
), you can add *.google.com
as a new entry to ExternalHosts
array.
我不知道为什么abc在链接,虽然。你有abc作为任何链接吗?是URI片段吗?
I am not sure why you get "abc" in the link, though. Do you have "abc" as a link to anything? Is it URI fragment?
这篇关于错误:在Phonegap中的白名单拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!