gpt4 book ai didi

Android Google Maps Direction Api - Api key 限制不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:57:21 26 4
gpt4 key购买 nike

enter image description here

当我们将 Google Maps Direction Api 的Key restriction 设置为 NONE 时,它工作正常。

但是当我们将Key restriction设置为Android apps并提供正确的Package name & SHA-1 certificate - 它说请求拒绝来自 Google Api 响应。

对此有任何已知的解决方案吗?

最佳答案

Directions API 是一种网络服务。与 Web 服务的 API key 一起使用的限制是 IP 限制。

假定 Web 服务请求在您的后端服务器上执行。如果您需要限制 API key ,解决方法是创建一个中间服务器。您的 Android 应用程序应向中间服务器发送请求,中间服务器应向 Google 发送请求并将响应传回您的应用程序。在这种情况下,您可以通过中间服务器的 IP 地址限制 API key 。

看看这个文档:

https://developers.google.com/maps/faq#using-google-maps-apis

希望这能澄清您的疑问。

关于Android Google Maps Direction Api - Api key 限制不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46178231/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com