简体   繁体   English

从我的Android应用程序查询google place api时请求被拒绝

[英]Request denied while querying the google places api from my android application

I am building an android application that gets the users location and returns places that are nearby using the google places api. 我正在构建一个Android应用程序,它获取用户位置并使用google places api返回附近的地方。

I have an api key and I am using this url: 我有一个api密钥,我正在使用这个网址:

https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false?key=mykey https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false?key=mykey

and I keep getting REQUEST_DENIED in my android application. 我一直在我的Android应用程序中获取REQUEST_DENIED The link works well on the browser and it returns a json. 该链接在浏览器上运行良好,它返回一个json。

I was having the same issue connecting to the Places API from my android app and receiving the request denied error. 我有同样的问题从我的Android应用程序连接到Places API并收到请求被拒绝错误。 The following post resolved my problem. 以下帖子解决了我的问题。 It explains that the Places API does not currently support Android or iOS keys generated from the API console at this time. 它解释了Places API目前不支持从API控制台生成的Android或iOS密钥。 I will be using the browser key for my app. 我将使用我的应用程序的浏览器密钥。

stackoverflow Places API Question stackoverflow Places API问题

Hope this helps! 希望这可以帮助!

I was facing the same problem use Browser Key as your key on android.This worked for me. 我正面临着同样的问题,使用Browser Key作为android上的密钥。这对我有用。 You don't need to fill any thing while creating browser key. 创建浏览器密钥时,您无需填写任何内容。

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

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