I’m looking to use this Google Places API url to search in an iOS app. Instead of using the designated location I would like to use the user’s current location:
NSURL *googlePlacesURL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=spa&sensor=false&key=AIzaSyAgcp4KtiTYifDSkIqd4-1IPBHCsU0r2_I"];
Would it be a matter of storing the users current location lat/lon and then placing those values in the NSURL?
thanks for any help
Your URl shows that you want to list place near by current location.
for that you need current location coordinates, radius, searched place name and key.
Do this:
Step 1: Add CoreLocation framework
Step 2: #import
Step 3: Add CLLocationManagerDelegate delegate
Step 4: Make CLLocationManager *locationManager;
Step 5: Initialise CLLocationManager ( usually in ViewDidLoad)
Step 6: Write code for CLLocationManager
Step 7: Use coordinates and fire request :
ENJOY