Google Place Picker API Query for App-scoped Places? - ios

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).

Related

Google Calendar API location swift iOS

I am making an app for iPhone that wants to fetch some data from Google Calendar, and I am programming in Swift. The data I want to fetch is location, time, date and title of event. I have not been able to find out how one gets the location data from Google Calendar. I know it exist in the pods to GoogleClientForRest/Calendar, but I am not able to access it. I thought I could access it from GTLRCalendar_Event, but it does available under this.
Xcode Error:
Can somebody please help me with this?
In your code you are using
GTLRCalendar_Event.location
This is the class itself, not an instance of it, so it has no data.
You need to use the instantiated object to fetch the properties.
Having a quick scan over the SDK you are using when you fetch a list of calendar entries it looks like you get a list of type [GTLRCalendar_CalendarListEntry] this type also has a location property which it looks like you could use.
If you could show more of your code I could give you a more specific answer as I haven't used this SDK in a while

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!

Getting closest place using google places api under 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.

Simple way to get surrounding area name like Facebook?

Hi all,
In Facebook app, when adding a new post, the app show surrounding area name.
This way of sharing place is cool, since it's automatically, and users don't need to choose from a list of venue names like Instagram app.
What is a quick way to get the same result as Facebook app?
I've used similar things before through services like google maps api.
https://developers.google.com/maps/
You can pass them a lat and long and get various bits of info back.
I'm not sure if that is now a paid service though. It wasn't when I last used it but I think it changed.
There may be other similar services available.
A more specific page from Google maps api...
https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding
I found that iOS have a built-in api CLGeocoder, this is more convenient to use than Web API:
- (void)reverseGeocodeLocation:(CLLocation *)location completionHandler:(CLGeocodeCompletionHandler)completionHandler;
This return you CLPlacemark with places, and areas.
http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLPlacemark_class/Reference/Reference.html
Here's a detailed comparison of all the geolocation solutions - Foursquare, Facebook, Google etc etc - http://crschmidt.net/blog/archives/463/working-with-place-apis-aka-how-i-spent-my-spring-vacation/
But this is actually what you are looking for if you intend to use Facebook Graph APIs for "places" - https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/show-nearby-places/
Specifically step 3 (https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/show-nearby-places/#step3)
Now that you have the current location, use it with the
FBPlacePickerViewController object to show the place picker when the
user taps on the ''Where are you?'' menu option.

Google Places API Violation

I am using Google Places API to pull a list of resturants, and I am displaying them on map. However, since Apple has switched there map services over from Google in iOS 6.0, I am now in violation of Google's terms of use, which states that you must display Google data on a Google map.
"If your application displays Places API data on a map, that map must be provided by Google."
https://developers.google.com/places/policies#terms_of_use
I obviously need to change the map, because I am not going to release an application that is in violation. Any thoughts or suggestions on what to do? Should I go Google Maps with a web view? Does apple have some sort of Google Places API alternative?
Edit:
Using Google Maps through a web view is a hassle, i'd like to find an alternative to that, although it would technically work.
I decided to use Google Maps JavaScript API. Although, it is a little more difficult to deal with, mainly the JavaScript through Objective-C, it is a solution. The map is displayed through a web view, and I use JavaScript to interact with the map.
https://developers.google.com/maps/documentation/javascript/tutorial#api_key
I will wait to accept this answer, to see if anyone else has any thoughts. I just wanted to post this, in case it helps someone else.
Edit:
Google recently released a Maps SDK for iOS, this is the better solution now.
https://developers.google.com/maps/documentation/ios/
I would try to directly contact Google, explaining the situation, and ask them for written permission to use Apple's maps. This is more a legal question than programming. One would think that Google is aware that you can no longer display their maps using Apple's API and that, even regardless of the map, they would want you to use their places, as doing so generates advertising revenue for them.
Agree with #Owen here - you could get permission to leave your app unchanged until some possible future date when you might have to change it, or could you definitely go to the effort of changing it now and then possibly have to change it again in the future for some other reason.
If you could get a 100% guarantee that you could change it once and never have to change it again then I'd say do it now, but nothing's certain.

Resources