Getting closest place using google places api under iOS - ios

It seems to me several things I can do using google places web service api, cannot be done using google places ios sdk.
What I want to achieve is just getting the closest pizzeria and its information like address and telephone number. I don't use maps.
I don't see in the iOS sdk a method or class to search places close a specific location with several conditions (like type=restaurant and keyword=pizza).
However I can do that using the web service directly, without an sdk, but of course requires more code.
Am I right? Is that normal? I mean, that the iOS version has not the same functionality than the webservice, while I guess it is just a wrapper of the web service.
Web service sdk:
https://developers.google.com/places/webservice/search
iOS sdk:
https://developers.google.com/places/ios/
Thanks.

Unfortunately Places API for iOS doesn't support "condition" likes types or keywords.
You can however implement autocomplete.
The autocomplete service in the Google Places API for iOS returns
place predictions in response to a text-based location search query.
The request includes a textual search string and optional filter
criteria. You can use this service to provide autocomplete
functionality as the user types, by returning places such as
businesses, addresses and points of interest.

Related

Google Places iOS SDK: How to Get Point of Interest Based on Text Search

If you go to google.com and search "Attractions in London", in the result page on the first line you will see a list of Point of Interest (POI) with its name, photo, and description.
I want to get this list of POI on my iOS app, without having the user typing "Attractions in London"; I will pre-load this list as suggested places in London. I've read through the Google Places API for IOS here: https://developers.google.com/places/ios-api/start. But I could not find any sample to search by text.
The only way I found is by accessing the Google Place Web Service API here: https://developers.google.com/places/web-service/search and do the text search. Get the JSON result and map it to my custom google place object.
Does anybody has experience doing this using client-site API iOS SDK? Not sure if I missed anything in their guide, or it's not documented or Web Service API the only way..
Thanks in advance!

Google Place Picker API Query for App-scoped Places?

I have recently been looking at the following link to add to my application. It is the Google Place Picker API. I also know how to add places to the list of places that the Place Picker API uses to query for so that my custom places can appear in Place Picker API. However, I want it so that the Place Picker API only queries for just the places that have been created only by my application, and not for any other places that the Google Places API provides. I have found that this example query, under the scope key, helps me find if the Place created was created via my app or by Google. I want it so that the Place Picker API queries only for the Places created by my app. Is there any way to do this? That would be much appreciated. Thanks!
It's not possible, sorry. Neither the iOS or Android Place Pickers have an option to do this.
In fact both the Android Place class and the iOS GMSPlace class lack the scope property, which only exists on the Places API web service today.
You'd have to build this yourself, e.g. by displaying a map and adding markers to it for your places, etc, rather than using the Place Picker widget from the Google Places API for iOS (or Android).

I need an API to plot waypoints and give me a route through them, and to give me city population. Which API should I use?

I'm making an iOS app that needs to be able to find the most populated cities within a radius from a certain point, and to calculate a route that passes through a certain number of those cities, that satisfy a certain time constraint. I'm planning to use Google to give me polylines that I can put directly on an Apple Map in the Mapkit for Xcode. I've looked into the Google Maps SDK for iOS, and Google Places. Google also has a Directions API, and a Distance Matrix API. With so many API's, I'm slightly confused about which one I should use, and for what.
Additionally, do Google API's provide city population, or should I find that via another database?
You can use Google Maps URL Scheme to get directions for Google Maps iOS.
If you are ever confused about which API to use for Google Maps, you can use API picker.
There is no Google API that give city population, so you would need to find it with a another database.

Google autocomplete Component Restriction iOS

is there any equivalent of a component restriction for Google Places Autocomplete for iOS.
I have found a few wrappers that wrap around the webservice call but even those (wrappers) do not have the capability to filter by component Restriction in general it seems.
I'm looking for this to make sure the results are only for my country of interest.
http://goobbe.com/questions/8144956/google-places-autocomplete-api-country-restriction
It's not possible with the iOS SDK at the moment.
The filter parameter of autocompleteQuery allows you to filter by type (it's a GMSAutocompleteFilter object), but currently offers no other filters.
For now you'll have to use the webservice (or a wrapper for the webservice that includes support for component restrictions).

Google Autocomplete API for use with MKMapKit

The app that I am currently working on has to do this kind of features.
1.User input "Address" and then there will be autocomplete (suggestion for that address)
2. After user hits search button . The MKMapkit has to bring user to that 'Address' and zoom region to that
I can do the #1 by using Google Autocomplete API and using this module TRAutocompleteView
Now ,I'm trying to figure to do #2 feature. I thought I can use Address result from google API to convert into lat,long by CLPlacemark but I tested the concept with this module which use CLPlacemark to convert address string
SPGooglePlacesAutocomplete
I found out that 20-30% of the address string can't be convert using CLPlacemark .It happes to be "Location not found" .And that happens mostly when you search in foreign language (I tried Thai language "
Are any other option for me implement these 2 features ? My app will be like YELP which has to search some result within specific region . Or can I use another way to do the address suggestion beside Google Autocomplete API ?
Changing MapKit to Google Map SDK can be one of the solution.But I want that to be last choice because it might be expensive if I exceed the daily limit
Thanks in advance
Just as a FYI, it is against the Google Terms of Service to use the Google Places Autocomplete with a non Google Map.
This is an obvious side effect of getting an address from Google and then asking Apple's API to turn those addresses into coordinates. Google will give you an address based on the data it has and the formatting style it wants, these will not always directly translate into Apple's data and format. If you want it to be properly reliable you need to stick with one set of services, Google or Apple, or a third party. It might be expensive if you exceed the daily limit but wouldn't that mean you're selling lots of copies of your app and such is the cost of doing business.

Resources