获取状态“REQUEST_DENIED”从Google Places API获取数据后 [英] Getting status "REQUEST_DENIED" after fetching data from google places API

查看:188
本文介绍了获取状态“REQUEST_DENIED”从Google Places API获取数据后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



I have done that

    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]; 

//但是我得到了这个 -

// But i am getting this-

** API Key有没有问题,我已经写了google map给出的API key。请问api键有问题吗?请告诉我这里是 google api链接

{ "html_attributions" : [], "results" : [], "status" : "REQUEST_DENIED" }

推荐答案

静态地图API和Places API每个都需要在API控制台中为该密钥启用。打开API控制台并启用对Places API的访问。有礼貌限制:每天有1,000个请求,之后您可能需要启用结算。

The Static Maps API and the Places API each need to be enabled in the API Console for that key. Open the API console and enable access to the Places API. There is a Courtesy limit: 1,000 requests/day, after that you might need to enable billing.

https://code.google.com/apis/console/

这篇关于获取状态“REQUEST_DENIED”从Google Places API获取数据后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆