适用于Android应用的Google Places API密钥

ihs*_*san 8 android google-maps google-maps-api-3 google-places-api google-play-services

API Key为我的Android应用程序创建了一个(用于Android应用程序).它是谷歌地图API所要求的.但现在相同的密钥不适用于Google Places API.

我还尝试使用以下URL访问浏览器:

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=my_key

我明白了:

{
   "error_message" : "This IP, site or mobile application is not authorized to use this API key.",
   "html_attributions" : [],
   "status" : "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)

当我用Google搜索答案时,我发现了这个:

https://developers.google.com/places/training/autocomplete-android

什么类型的API密钥?

在开始使用Place Autcomplete服务之前,您需要自己的Google Places API浏览器或服务器API密钥.请注意,Android API密钥不适用于地方自动填充服务.

这让我很困惑,因为我没有任何网络应用程序的URL,也没有任何服务器IP.因此,我很困惑如何得到一个Browser key或一个Server key

有谁能帮我弄清楚这里需要什么样的钥匙?另外,如果我必须创建一个Browser key或一个Server key,我该怎么办?

som*_*one 8

看到这个 doc知道如何获取google places API密钥

查看教程以集成Google地方信息


小智 5

对于使用places api生成浏览器密钥,因为那个android密钥不起作用.有同样的问题,但这解决了问题