iOS Google Places API : "This IP, site or mobile application is not authorized to use this API key"

标签 ios ios7 google-places-api google-places

我正在 iOS 7 应用程序上测试 Google Places API。

当我向 API 发送请求时,我得到一个带有以下错误消息的 json 结果:

此 IP、站点或移动应用程序无权使用此 API key 。

为了构建请求,我转到了 Google API 控制台并根据我的应用程序包生成了我的 iOS API key 。

我没有在应用程序上使用 Google map 或其他任何东西,只是试图向 Places API 发出请求。

有什么我遗漏的吗?

PS:我复制了我正在使用的 URL,并将 API key 更改为浏览器客户端 key ,并在 Chrome 中对其进行了测试并且运行良好。

最佳答案

您是否尝试过在 iOS 应用程序中使用浏览器客户端 key ?据我所知,places API 不支持 iOS key 。

更多信息在这里:https://groups.google.com/forum/#!topic/google-places-api/Jlm15dG7eMA

来自 google api 控制台文档:https://developers.google.com/console/help/#generatingdevkeys

关于iOS Google Places API : "This IP, site or mobile application is not authorized to use this API key",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23163663/

相关文章:

objective-c - 触摸详细信息披露指示器时 Mapview 注释崩溃

ios - 获取两个位置之间的路点

ios - IBDesignable View 内的 IBInspectable 按钮

ios - 这是如何工作的? - 越狱调整

ios - Xcode 项目重命名,现在丢失了

ios - 使用 NSIndexPath 访问嵌套元素

ios - 针对 ios6.1 编译的 Xcode 5 不保留布局

swift - 符合 Swift 协议(protocol)的 GMSAutocompleteResultsViewControllerDelegate

android - 在 android 中使用 google maps v2 查找最近的加油站,并希望显示到它的路线

ios - 我可以更改 iOS 版 Google Places API 的结果语言吗?