简体   繁体   English

谷歌路线 API 和安卓

[英]Google Directions API and android

In my app I use Google Directions API to draw a route from point A to point B on my map.在我的应用程序中,我使用 Google Directions API 在地图上绘制从 A 点到 B 点的路线。

When I try to get my route I get 403 with message "This IP, site or mobile application is not authorized to use this API key.", but this issue arises only when I try to restrict my API key to be used by android apps.当我尝试获取我的路由时,我收到 403 消息“此 IP、站点或移动应用程序无权使用此 API 密钥。”,但仅当我尝试限制我的 API 密钥以供 Android 应用程序使用时才会出现此问题. When I drop the restriction everything works fine.当我取消限制时,一切正常。 Package and fingerprint are correct, the issue is actual for both debug and release builds.包和指纹是正确的,这个问题对于调试和发布版本都是实际的。 Am I missing something?我错过了什么吗?

Thanks in advance!提前致谢!

You should set your API key to not restricting.您应该将 API 密钥设置为不限制。 I had the same problem but fixed it this way.我遇到了同样的问题,但以这种方式修复了它。

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

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