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.
請讓我知道該怎麼做?
首先刪除您的網址不必要的空白。 –
我的代碼中沒有空格,這些只出現在這裏...我也得到了回覆...但是狀態是「REQUEST_DENIED」,但我有API密鑰,並且已經在API中啓用了位置API和Google MAP訪問部分.. – user3121532
你可以發佈你的最終網址嗎? –