我正在使用 Google map 构建一个 PhoneGap 应用程序,目前面向 Android。如果我只将maps.googleapis.com列入白名单,则不起作用。事件对象不存在。如果我将所有域列入白名单,它就会起作用。
我不想允许访问所有域。除了maps.googleapis.com 之外,我还需要允许访问哪些域?
最佳答案
语法取决于您使用的 PhoneGap 版本。有关详细信息,请参阅文档的相关版本 - 例如。 http://docs.phonegap.com/en/3.1.0/guide_appdev_whitelist_index.md.html
对于 3.1 或更高版本,以下内容适用于我:
<access origin="*://*.googleapis.com/*" subdomains="true" />
<access origin="*://*.gstatic.com/*" subdomains="true" />
<access origin="*://*.google.com/*" subdomains="true" />
<access origin="*://*.googleusercontent.com/*" subdomains="true" />
关于android - 带 Google map 的 PhoneGap/Android 应用程序的域白名单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19309306/