Obtaining locations around user API? - ios

I'm attempting to retrieve locations around a user upon retrieving their current location. Is anyone familiar with which API's/Frameworks are best to accomplish this? I've tried Foursquare2 but it seems that half the locations don't return addresses. I need a better API to use, preferably one that will return addresses, and can't seem to find any others. I came across Google Places, but it appears to be in beta and not available unless I submit a form and wait. Is there a way to do this with Google Maps or the Facebook graph perhaps?

Depending on which device you use. For example if you want to retrieve location data from android use this api, for an ios device, use read the my location section in this doc. Hope this gives you some idea.

Related

Proximity Based Search without user location swift

I'm working on an app which utilizes Google Places API in order to find locations based on a users search. I've implemented the search with the help of the UIAutocomplete (Google Places), but unfortunately, it is not location based (until the user provides authorization). I was wondering if there is a way to get the users location through their IP address or otherwise using Swift. I don't need a precise location, the city would be enough.
I've searched for a while and there doesn't seem to be any other way of doing this, so if you know of an API which can return the city the user is currently in, that would be great.
Thanks for all the help,
Vlad
I don't think the system frameworks allow you to get the user's remote IP address anymore. A solution for you might be to use a website like http://mylocation.org/, which shows your IP address and location. Perhaps you can make a request to this website and parse out the HTML that comes back to get the location. Please note, this isn't the most accurate way of getting the user's location and you would be much better off using the CoreLocation framework.

Using Google Maps to store custom set of locations (iOS Google Maps SDK)

Create mobile application, which gives the user ability to look for certain places (payment terminals) nearby and to add new ones. Of course user will have ability to edit places, change some of their meta-info fields, add photos, etc.
I can understand, how to implement such things at the mobile device side(i mean interface and model), but can't imagine, what i have to do at the "google-side" to store locations and get them to device.
I'm looking through developers.google.com for appropriate service, but google have so much different "Maps" services and their variety makes me disappointed, which one can give me necessary instruments.
I'm sorry, if my question is too stupid but i can't realize how to implement such functionality.
If anybody ever made such applications, please help me to find, at least, the service, which can help me to implement such functionality. Sample code at github will be the great!
You're looking to build a "back-end" or a database to store the locations that you are interested in. This means that you will save them on a server, that you will access through requests over the internet from your iPhone.
For a really simple back-end to set up, check out Parse that is very simple to implement.

Is it possible to use CoreLocation/MapKit to find addresses near a Latitude/Longitude?

I am developing an iPhone app for iOS 6.1 or later. I would like to have a feature that would provide the user a list of addresses that are nearby. I know I can use a geocoder with a reverseGeocodeLocation call to get the address of a specific latitude/longitude. But what I need is not just that address, but also, a few (maybe 10) addresses that are near that address.
The MKLocalSearchRequest doesn't seem to support any kind of search request that would return that information. (I am not searching for hotels, or restaurants, etc., just any valid nearby addresses) Does anyone know of a way to do this?
There's no API for that, the only thing I can think of is using a for loop and increasing manually latitude/longitude and reverse geocoding.
After doing more research into other map API's from third parties (Google, Mapquest, Bing) I have still been unable to find one that provides this functionality. The answer to my question therefore appears to be that it currently can't be done. The only solution to my problem was to have a complete list of addresses geocoded in a database. (Fortunately for me, my organization has such a database available.)

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