2013-12-20 72 views
1

我使用Google Map API获取ATM附近的纬度和经度。我通过Google凭据获取Google API密钥。我通过我的应用程序代码麻烦靠近ATM列表

NSString *url = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search  /json?location=%f,%f&radius=%@&types=%@&sensor=true&key=%@", currentCentre.latitude, currentCentre.longitude, [NSString stringWithFormat:@"%i", currenDist], googleType, kGOOGLE_API_KEY]; 
NSURL *googleRequestURL=[NSURL URLWithString:url]; 
NSData* data = [NSData dataWithContentsOfURL: googleRequestURL]; 
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; 

请求和我得到

{ 
    "debug_info" =  (
    ); 
    "html_attributions" =  (
    ); 
    results =  (
    ); 
    status = "REQUEST_DENIED"; 
} as response. 

请让我知道该怎么做?

+0

首先删除您的网址不必要的空白。 –

+0

我的代码中没有空格,这些只出现在这里...我也得到了回复...但是状态是“REQUEST_DENIED”,但我有API密钥,并且已经在API中启用了位置API和Google MAP访问部分.. – user3121532

+0

你可以发布你的最终网址吗? –

回答

0

我认为你需要使用谷歌API地方为获取ATM位置查找下面的链接

How to get 20+ result from Google Places API?

+0

我以相同的方式使用。我正在使用API​​密钥正确地请求格式。我已启用我的Google凭据所需的所有访问权限,但未收到status =“REQUEST_DENIED”的回复。 – user3121532