适用于iOS的Google Places API与Google放置Web服务 [英] Google Places API for iOS vs Google places Web service

查看:409
本文介绍了适用于iOS的Google Places API与Google放置Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算让一个应用程序在 UITableView 中用 UISearchController 结合自动完成功能列出附近的地方过滤地点的结果,我正在尝试使用Google Places API。

我很困惑,因为我不知道应该使用哪个API:


  • Google Places API网路服务






  • 适用于iOS的Google Places API



我没有找到获取列表的方法 Google Places API for iOS 文档中的地点。


  1. 何时使用 Google Places API Web服务以及何时使用 Google Places API对于iOS ?在我的情况下最好的办法是获得分页和按名称和类别选项过滤的地方列表。

  2. 我已经为 Google Places API for iOS 可以在 Google Places API Web服务中使用此密钥吗?


$ b $一般来说,如果为iOS开发,您应该更喜欢iOS的Google Places API。它被设计成比使用Web服务更容易使用和更高效。



然而,iOS的Places API相对较新,并且还没有Web服务的所有功能。在这种情况下,您可能更愿意仅使用Web服务,或者将iOS的Places API和Web服务结合使用。



针对您的特定用例,我会建议使用Places API for iOS getCurrentPlace功能+自动完成功能。 getCurrentPlace返回我们相信设备所在位置的列表。



如果这不符合您的需求,您可以使用来自iOS API的Web Service + Autocomplete中的附近搜索。



对于问题2:您不能对iOS和Web服务使用相同的API密钥。前者需要iOS密钥,后者需要服务器密钥。您还需要在Google Developers Console中启用这两项服务。


I plan to have an application to list nearby places in a UITableView with UISearchController combined by Auto-complete feature to filter the result of places and I'm trying to use Google Places API.

I'm confused because I don't know which API should I use:

  • Google Places API Web Service

or

  • Google Places API for iOS

I didn't find a way to get a list of places in the Google Places API for iOS documentation.

  1. When to use Google Places API Web Service and when to use Google Places API for iOS ? and what works best in my case (get list of places with pagination and filter by name and category options)

  2. I have already generated an API-KEY for Google Places API for iOS can I still use this key in Google Places API Web Service ?

解决方案

In general, if developing for iOS, you should prefer the Google Places API for iOS. It is designed to be easier to use and more efficient from iOS than using the Web Service.

However, the Places API for iOS is relatively new, and does not yet have all the features of the Web Service. In this case, you might prefer to use only the Web Service, or to combine the Places API for iOS and the Web Service.

For your particular use case, I would recommend using the Places API for iOS getCurrentPlace functionality + Autocomplete. getCurrentPlace returns a list of places where we believe the device to be located.

If that doesn't meet your needs, you could use nearby search from the Web Service + Autocomplete from the iOS API.

For question #2: You cannot use the same API Key for iOS and Web Services. The former requires an iOS Key, and the latter a Server key. You also need to enable both services in the Google Developers Console.

这篇关于适用于iOS的Google Places API与Google放置Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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