iOS Google Places API:“此IP,网站或移动应用程序无权使用此API密钥” [英] iOS Google Places API: "This IP, site or mobile application is not authorized to use this API key"

查看:421
本文介绍了iOS Google Places API:“此IP,网站或移动应用程序无权使用此API密钥”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am testing the Google Places API on an iOS 7 app.

当我向API发送请求时,我收到json结果,并显示以下错误消息:

When I send a request to the API I get a json result with the following error message:

此IP,网站或移动应用程序无权使用此API密钥。

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

To build the request, I went to the Google API console and generated my iOS API Key based on my application bundle.

我'我没有在应用上使用Google地图或其他任何内容,只是尝试向Places API发出请求。

I'm not using Google Maps or anything else on the app, just trying to make a request to the Places API.

我有什么遗漏吗?

PS:我复制了我正在使用的网址,并将API密钥更改为浏览器客户端密钥,并在Chrome中进行了测试并完美运行。

PS: I copied the URL I'm using and changed the API key to the browser client key and tested it in Chrome and worked perfectly.

推荐答案

您是否尝试过在iOS应用中使用浏览器客户端密钥?根据我的记忆,places API不支持iOS密钥。

Have you tried using the browser client key inside the iOS app? From what I remember, the places API doesn't support iOS keys.

此处有更多信息:https://groups.google.com/forum/#!topic/google-places-api/Jlm15dG7eMA

从谷歌api控制台文档: https://developers.google.com/console/help / #givingdevkeys

And from the google api console docs: https://developers.google.com/console/help/#generatingdevkeys

这篇关于iOS Google Places API:“此IP,网站或移动应用程序无权使用此API密钥”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆