【问题标题】:This IP, site or mobile application is not authorized to use this API key. Request received from IP address此 IP、站点或移动应用程序无权使用此 API 密钥。从 IP 地址收到的请求
【发布时间】:2016-02-02 09:29:30
【问题描述】:

我正在尝试使用以下 URL 在两个位置之间绘制路线

"https://maps.googleapis.com/maps/api/directions/json?" + params + androidKey;

其中params 是起点和终点的纬度和经度,androidKey 是我使用我的 SHA 指纹从 Google 控制台收到的 Android 密钥。我已启用 Google Maps Android API、Google Places API for Android、Google Places API Web Service 等,但是当我尝试在手机上运行该应用程序时仍然收到以下响应

This IP, site or mobile application is not authorized to use this API key. Request received from IP address

我尝试使用服务器密钥导致以下响应

This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console

有人可以帮忙吗? 谢谢

【问题讨论】:

标签: android google-maps google-maps-api-3


【解决方案1】:
  1. 确保您已在 Google Api 控制台中启用 Google Maps Directions API
  2. 你必须使用你的Server_key

    例如:https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=Server_key

只有在google api控制台启用API后才得到响应。

【讨论】:

    猜你喜欢
    • 2021-10-29
    • 1970-01-01
    • 2014-03-22
    • 1970-01-01
    • 2014-07-19
    • 1970-01-01
    • 2016-04-03
    • 1970-01-01
    • 2014-06-10
    相关资源
    最近更新 更多