【发布时间】:2012-08-29 19:10:59
【问题描述】:
我已经做到了
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.722322,76.76126&radius=500&types=food&sensor=true&key=any_apiKey"]];
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *strResponse = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(@"%@",strResponse);
SBJSON *sbJason = [[SBJSON alloc] init];
NSMutableDictionary *getPlaceList = [sbJason objectWithString:strResponse];
// 但我得到了这个-
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
**API 密钥有什么问题吗?我写了谷歌地图给出的 API 密钥。 api密钥有什么问题吗?或者请告诉我这里是link of google api
【问题讨论】:
-
您是否真的将“any_apikey”作为您的 api 密钥传递?
-
不不,这不是我真正的 api 密钥。我有 google 提供的不同 api 密钥
-
好的,很好:) 只是想检查一下
-
你在PC浏览器上试过这个网址吗?
-
REQUEST_DENIED指向无效密钥。仔细检查密钥以及如何从places API提供密钥
标签: iphone objective-c ios google-maps google-maps-api-3