我正在为我的 iOS 应用程序使用 Google Places API。我已启用 Google Maps Android API v2,来自 API 控制台的 Places API。在 API 访问部分创建一个 iOS 密钥。我正在使用以下代码向 Google Places API 发出请求:
NSString *finalString = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=%f,%f&radius=5000&keyword=restaurants&sensor=false&key=PASTE_GENERATED_KEY_HERE",_location.coordinate.latitude,_location.coordinate.longitude];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:finalString]];
但我在 JSON 响应中得到关注
{
"debug_info" = (
);
"html_attributions" = (
);
results = (
);
status = "REQUEST_DENIED";
}
我已经重新生成了不起作用的新密钥。有人可以弄清楚我在这里做错了什么。