小编Ran*_*sif的帖子

Google Places API响应状态"Request_Denied"

我正在为我的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]];
Run Code Online (Sandbox Code Playgroud)

但是我在JSON Response中得到了关注

{
    "debug_info" =     (
    );
    "html_attributions" =     (
    );
    results =     (
    );
    status = "REQUEST_DENIED";
}
Run Code Online (Sandbox Code Playgroud)

我重新生成了一个不起作用的新密钥.有人可以弄清楚我在这里做错了什么.

iphone google-maps ios google-places-api

1
推荐指数
1
解决办法
4142
查看次数

标签 统计

google-maps ×1

google-places-api ×1

ios ×1

iphone ×1