谷歌地图API未在iOS中返回结果 [英] Google Directions API failing to return results in iOS

查看:546
本文介绍了谷歌地图API未在iOS中返回结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用谷歌地图API。我有SDK中的所有设置。我已经启用的谷歌地图SDK iOS版下的服务的开发者控制台。以下是我已经建立,以获得方向上的网址。

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

首先,我试图与主要的iOS应用。

<$p$p><$c$c>https://maps.googleapis.com/maps/api/directions/json?origin=-37.814107,144.96328&destination=-31.953004,115.857469&key=<Key对于iOS应用&GT;

但我得到了错误的此IP,网站或移动应用程序无权使用这个API密钥

当我寻找一个解决这个错误我在几个StackOverflow的答案看到( 1 ,的2 )的iOS的键不被支持。在他们谈论了谷歌Places API的问题的答案,但我想这可能是与方向不变的情况下,因为错误是一样的。

所以我取代了的主要适用于iOS应用的用的键为浏览器的应用的并再次运行它,但我得到了一个新的错误的此API项目未授权使用这个API。请确保此API在API控制台

激活

是我的问题是有没有其他的API我在服务激活得到这个工作?这些都是在列表相关的API谷歌其他地图。


解决方案

该API谷歌地图SDK适用于iOS - 它只是整合了谷歌地图SDK ......

如果你想在谷歌控制台利用路线..你必须激活:路线API ,过于的 developers.google.com/maps/documentation/directions

编程快乐!

I’m trying to use Google Directions API. I have the SDK all set up. I have enabled Google Maps SDK for iOS under the Services in the developer console. Below is the URL I've built to get the directions.

There are two types of keys in the developer console.

First I tried with the Key for iOS apps.

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

But I got the error This IP, site or mobile application is not authorized to use this API key.

When I searched for a solution to this error I saw in a few StackOverflow answers (1, 2) that iOS keys are not supported. In the answers they're talking about the Google Places API but I thought it might be the same case with Directions because the error was the same.

So I replaces the Key for iOS apps with Key for browser apps and ran it again but I got a new error This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console.

My question is are there any other APIs I have to activate in the Services to get this working? These are the other map related Google APIs in the list.

解决方案

The API "Google Maps SDK for iOS" - it is only for integrating the "Google Maps SDK"...

If you want to "use" Directions.. you have to "activate" in the Google console: "Directions API" , too developers.google.com/maps/documentation/directions

Happy coding!

这篇关于谷歌地图API未在iOS中返回结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆