I am trying get the lat lon value from the shortened google maps url, https://goo.gl/maps/81bgEw3JYMT2
I have tried with googleapi and get the following response, https://www.googleapis.com/urlshortener/v1/url?shortUrl=https://goo.gl/maps/81bgEw3JYMT2&key=USE_YOUR_KEY
{
"kind": "urlshortener#url",
"id": "https://goo.gl/maps/81bgEw3JYMT2",
"longUrl": "https://maps.google.com/?q=Meenakshi+Amman+Temple,+Madurai,+Tamil+Nadu+625001&ftid=0x3b00c58461e46987:0xf134621ce5286703&hl=en-US&gl=us&shorturl=1",
"status": "OK"
}
I have also tried checking with the redirection URL, and i get the following finalurl, https://maps.google.com/?q=Meenakshi+Amman+Temple,+Madurai,+Tamil+Nadu+625001&ftid=0x3b00c58461e46987:0xf134621ce5286703&hl=en-US&gl=us
Code for checking the redirection URL,
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
[request setHTTPMethod:@"HEAD"];
NSURLResponse *response = nil;
[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
NSURL *finalURL = response.URL;
Is there another way to get the lat lon value?
Bounty: Accepted answer will get promocode for the app I'm working for. ;)