我是移动开发新手。我正在使用 Phonegap/Cordova 创建跨平台应用程序。我的代码在 Android 上运行良好,但是当我将它移植到 iPhone 时,它显示错误:
[143:2003] ERROR whitelist rejection: url="abc"
现在我可以克服这个问题吗?
最佳答案
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 数组中。
例如,如果要允许访问此 URL http://www.myhost.com/path/file
,则添加 www.myhost.com
作为 ExternalHosts
数组的新条目。
如果您想允许访问 Google 所有子域(例如 maps.google.com
、mails.google.com
)上的内容,您可以添加 *.google.com
作为 ExternalHosts
数组的新条目。
不过,我不确定为什么您会在链接中看到“abc”。你有“abc”作为任何东西的链接吗?是URI片段吗?
关于iphone - 错误 : Whitelist rejection in Phonegap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10795628/