【问题标题】:Google Directions API failing to return results in iOSGoogle Directions API 无法在 iOS 中返回结果
【发布时间】:2014-11-29 11:25:46
【问题描述】:

我正在尝试使用 Google Directions API。我已经设置好了 SDK。我在开发者控制台的服务下启用了 Google Maps SDK for iOS。以下是我为获取路线而构建的 URL。

开发者控制台中有两种类型的密钥。

首先我尝试了 iOS 应用的 Key。

https://maps.googleapis.com/maps/api/directions/json?origin=-37.814107,144.96328&destination=-31.953004,115.857469&key=<Key for iOS apps>

但我收到错误此 IP、站点或移动应用程序无权使用此 API 密钥

当我搜索此错误的解决方案时,我在一些 StackOverflow 答案(12)中看到不支持 iOS 键。在他们谈论 Google Places API 的答案中,但我认为方向可能是相同的情况,因为错误是相同的。

所以我将 iOS 应用程序密钥 替换为 浏览器应用程序密钥 并再次运行它,但出现新错误 此 API 项目未获授权使用这个 API。请确保在 API 控制台中激活了此 API

我的问题是我必须在服务中激活其他 API 才能使其正常工作吗?这些是列表中其他与地图相关的 Google API。

【问题讨论】:

  • 如果你想“使用”Directions.. 你也必须在 Google 控制台中“激活”:“Directions API”developers.google.com/maps/documentation/directions
  • @TonyMkenu 就是这样!现在它的工作。不敢相信我错过了!谢谢你。如果您可以将其发布为答案,我可以接受。

标签: ios api google-maps ios8 directions


【解决方案1】:

API“Google Maps SDK for iOS” - 仅用于集成“Google Maps SDK”...

如果你想“使用”Directions.. 你必须在 Google 控制台中“激活”:“Directions API”,developers.google.com/maps/documentation/directions

编码愉快!

【讨论】:

    【解决方案2】:

    你在使用 https://developers.google.com/maps/documentation/ios/ 那里也有一个很好的文档。 是的,登录时需要在google api中心激活IOS Maps SDK

    【讨论】:

    • 是的,这就是我正在关注的文档。是的,我已经启用了 Google Maps for iOS SDK API。我还需要从these 激活其他 API 吗?
    猜你喜欢
    • 2016-08-07
    • 2016-12-22
    • 2016-05-04
    • 1970-01-01
    • 2018-11-30
    • 2018-02-13
    • 2018-05-26
    • 1970-01-01
    相关资源
    最近更新 更多