我已经在我的android应用程序中集成了Google Places API。我已经阅读了api文档See Here。
我已经激活了Google Places Api for android并生成了浏览器密钥,当我调用api get error in response时-
{"error_message" : "This API project is not authorized to use this API.Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}我也尝试创建android密钥,它返回-
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key.",
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}我不明白我的代码中有什么问题。
任何帮助都是非常感谢的。提前谢谢。
检查API控制台-

发布于 2015-07-07 00:35:48
我也有同样的问题。在我的例子中,问题是我试图通过这个url使用简单的HttpUrlconnection发送请求:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=62.25227243964484%2C59.12338379770518&radius=500&key=my_key其中my_key是Google Places API for Android的关键,但当我切换到Google Places API Web Service时,它工作得很好。似乎要使用key for Google Places API for Android,你应该遵循这个指南https://developers.google.com/places/android/
发布于 2015-05-06 06:43:34
看起来您正在使用Places API Web服务,这需要启用"Google Places API Web Service“并提供一个服务器密钥:https://developers.google.com/places/webservice/intro#Authentication
由于您正在构建一个Android应用程序,您可能想要尝试一下我们在3月份刚刚发布的Places API for Android :)文档可以在https://developers.google.com/places/android/上找到
我希望这能帮到你!
发布于 2015-09-14 19:12:03
我通过以下先决条件解决了这个问题:
1)确保您使用的是以下URL
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=YOURSEARCHTEXT&key=YOUR_SERVER_API_KEY.不要使用你的android/IOS API密钥。
2)请确保您在控制台中开启了以下接口。
Google Places API服务(付费服务)
https://stackoverflow.com/questions/30044562
复制相似问题