Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

android - REQUEST_DENIED with Google Places API browser key or app key?

I'm writing an application in Android that needs the Google Places API. I have made a key through the Google console, for both my browser and my specific application. The application key already works with Google Maps. To do a request to the Google Places API, though, it seems I have to use the browser key for it to work. It won't work with the application key, because that results in a REQUEST_DENIED.

Somebody knows how this is possible? Or is this normal?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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"

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...