简体   繁体   English

Android Google放置API REQUEST_DENIED

[英]Android Google places API REQUEST_DENIED

Hello I am using GOOGLE maps API for android, and using my API key I am able to draw map. 您好,我正在使用适用于Android的GOOGLE maps API,并且可以使用我的API密钥绘制地图。

Also added zoom in zoom out function. 还增加了放大缩小功能。 But when I try to fetch data from google API it gives me REQUEST_DENIED error message. 但是,当我尝试从Google API提取数据时,它给了我REQUEST_DENIED错误消息。

Here is my query string 这是我的查询字符串

https://maps.googleapis.com/maps/api/place/search/json?location=43.666,93.166&radius=5000&sensor=false&types=establishment&name=hotel&key={myKey}

I have tried many links to generate key 我尝试了许多链接来生成密钥

Also tried this link. 还尝试了链接。

Help needed stuck in this problem for the last two days. 在过去的两天内,需要帮助解决此问题。

If your keyApi is a android key won't work because you need a browser api (leave in black for all access allowed). 如果您的keyApi是android密钥,则将无法使用,因为您需要浏览器api(保留所有允许的访问为黑色)。 From this link 从这个连结

"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" “访问Google Places API涉及浏览器的http / https请求。您创建的应用程序密钥不适用于Google Places,因为它需要一个浏览器密钥。您需要在Google API控制台上创建一个新的浏览器密钥,点击“创建新的浏览器密钥”

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." 还请将来自这些HTTP引荐来源网址(网站)的“接受”请求保留为空,以便允许其访问所有引荐来源,并在查询URL中包含生成的密钥。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM