我正在 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/