2013-12-20 75 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