谷歌的地方API请求被拒绝的Andr​​oid自动完成,即使有正确的API密钥 [英] Google Places API request denied for Android autocomplete, even with the right api key

查看:138
本文介绍了谷歌的地方API请求被拒绝的Andr​​oid自动完成,即使有正确的API密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让自动完成字段,应取城市为用户类型,通过在本教程中描述的谷歌API的地方: <一href="https://developers.google.com/places/training/autocomplete-android">https://developers.google.com/places/training/autocomplete-android

I'm trying to make an Autocomplete field which should fetch cities as the user types, by using the Google Places API as described in this tutorial: https://developers.google.com/places/training/autocomplete-android

您可能已经发现了这个问题上很多次才和我一样,但没有答案的帮助了我。这里有件事情你应该知道的:

You've probably found this question around many times before as I did, but none of the answers helped me. Here are the things you should know:

网址 <一href="https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=myKey&components=country:ro&input=whatTheUserTypes">https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=myKey&components=country:ro&input=whatTheUserTypes

请不要说你自己取代了API密钥和它的工作回复 - API密钥肚里必须有具体的Andr​​oid并不会从浏览器中运行。

Please don't reply by saying you replaced the API key with your own and it worked - the API key which goes there must be Android specific and won't work from a browser.

所以我才让使用从我与签署的应用程序密钥库中获得的SHA1指纹Android的API密钥。 我打开地图和地点的API从控制台。 配额不超标。

So did I make the Android API key using the SHA1 fingerprint obtained from the keystore I signed the app with. I turned on Maps and Places APIs from the console. The quota isn't exceeded.

所有这些,它仍然给了我REQUEST_DENIED

All those and it still gives me REQUEST_DENIED

我没有提到的是,我已经O2Auth启动 - 这是否能改变什么?难道不应该是简单的把API密钥的应用程序?

What I didn't mention is that I have O2Auth activated - does that change anything? Shouldn't it be as simple as putting the API key in the app?

谢谢!

推荐答案

在谷歌的地方API目前不支持Android或iOS的钥匙。目前仅支持服务器和浏览器键。

The Google Places API does not currently support Android or iOS keys generated from the Google APIs Console. Only Server and Browser keys are currently supported.

如果你想要求这种支持,请提交一份 API的地方 - 功能要求

If you would like to request this support, please file a Places API - Feature Request.

这篇关于谷歌的地方API请求被拒绝的Andr​​oid自动完成,即使有正确的API密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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