How to get the location coordinate based on nickname - uber-api

I am using the uber sdk for iOS. And i see I have to specify the
button.setProductID("abc123-productID")
button.setPickupLocation(latitude: "37.770", longitude: "-122.466", nickname: "California Academy of Sciences")
button.setDropoffLocation(latitude: "37.791", longitude: "-122.405", nickname: "Pier 39")
How can I get the coordinate information based on the location's nickname.

The iOS Uber SDK doesn't provide this functionality. However, Apple's CoreLocation framework has the CLGeocoder class that provides both forward-geocoding and reverse-geocoding. To convert an address into coordinates to pass to the request button, you can use the function geocodeAddressString:completionHandler:.

Related

How can I get a user's city location in flutter

I'm tying to get a user's location( just the user's city location) I am await of the plugin geolocation in flutter and I want to know if there's a way I can get just the user's city location.
You need to geocode the coordinates given by your plugin
To do that, there is another plugin like geolocator which provides both features :
Get the current location of the device
Translate an address to geocoordinates and vice verse
The geocoding part can be find here

API for Get venues for nearrby Location in foursquare

1)I want to fetch the venues for the nearby location by passing the latitude and longitude of to the API in foursquare.
I got this url:-thisand i got peroper response.
But for this latitude and longitude:- 32.3456,141.4346
(url)
I did not get any data.
Same for Facebook.I use this :- facebook API
But i want the list of generalized category listing from this API.And this API only gives me data of hotels only.Because i pass q=hotel.
2)How to get oauth_token for foursquare?
Please help me.
The reason you did not get any data for that location is because there are no venues in that area. If you follow this link you will see that location is in a remote area of Australia.
For help with connecting users to Foursquare, you can use these instructions

Embedding current location ( longitude and latitude ) in the Google Places API

I am trying to integrate Google Places API into my iOS app. I am referring to this blog :
http://iphonebyradix.blogspot.com/2011/07/working-with-google-places-api.html
Now I am finding out my current location of the iPhone, how do I embed the longitude and latitude which I have got into the following URL instead of "location=34.0522222,-118.2427778" :
#define PlacesURL #"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=restaurants&sensor=false&key=Your_API_Key"
So that I get the restaurants locations near my current location and not near the hard coded location given in the code.
Thanks and Regards.
CLLocation *location = [[AppHelper appDelegate] mLatestLocation];//custom code to get latestPosition of user
NSString *url=[NSString stringWithFormat:#"https://maps.googleapis.com/maps/api/place/search/xml?location=%f,%f&radius=500&types=restaurants&sensor=false&key=Your_API_Key"
,location.coordinate.longitude,location.coordinate.latitude]];

google map in iphone sdk?

i can get current latitude and longitude from iphone sdk. but is there any google map URL
if i send current location and some text to give latitude & longitude value for that text .
Please check with following URL to get latitude and longitude values;
http://code.google.com/apis/maps/documentation/geocoding/#GeocodingRequests

get city name by parsing in iphone sdk

From this url:
http://ws.geonames.org/findNearbyPostalCodes?lat=19.0176560&lng=72.8561780
I want is city name that is mumbai can somebody help me?
Once you have parsed out the latitude and longitude, you can use the MKReverseGeocoder to translate that location to meta data about that location. In that meta data, you will find the city name that you are after.
Update
Have a look at the Apple CurrentAddress sample app, this has an example of how you use the MKReverseGeocoder.