REQUEST_DENIED与谷歌的地方API浏览器键或应用程序键? [英] REQUEST_DENIED with Google Places API browser key or app key?

查看:381
本文介绍了REQUEST_DENIED与谷歌的地方API浏览器键或应用程序键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的Andr​​oid的应用程序,需要谷歌的地方API。 我已经通过谷歌控制台的关键,为我的浏览器,我的具体应用。该应用程序键已经可以与谷歌地图。 要做到一个请求,谷歌API的地方,不过,看来我必须使用浏览器密钥为它工作。它不会与该应用程序按键工作,因为其导​​致一个REQUEST_DENIED

I'm writing an application in Android that needs the Google Places API. I have made a key through the Google console, for both my browser and my specific application. The application key already works with Google Maps. To do a request to the Google Places API, though, it seems I have to use the browser key for it to work. It won't work with the application key, because that results in a REQUEST_DENIED.

有人知道这怎么可能?或者,这正常吗?

Somebody knows how this is possible? Or is this normal?

推荐答案

访问谷歌的地方API,包括来自浏览器的HTTP / HTTPS请求。你所创建的应用程序键不会对谷歌的地方工作,因为它需要一个浏览器键。您需要创建的谷歌API控制台,点击创建新的浏览器密钥一个新的浏览器键

Accessing Google places API involves a http/https request from the browser. The application key you created wouldn't work for the Google places as it needs a browser key. You need to create a new browser key on the Google API console clicking the "Create new Browser Key"

同样的,把接受来自这些HTTP查阅情况请求(网站):的空白,以便它可以访问所有的引荐并在您的查询URL生成的密钥

Also leave the Accept requests from these HTTP referers (web sites): blank so that it allows access to all referrers and include the key generated in your query URL.

这篇关于REQUEST_DENIED与谷歌的地方API浏览器键或应用程序键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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