我尝试通过 Google API 获取用户信息,但是 我收到以下错误:
error: {
errors: [
{
domain: "usageLimits",
reason: "accessNotConfigured",
message: "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
code: 403,
message: "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
我的代码如下:
-(void)get_real_profile:(NSString*)userid
{
// POST parameters
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.googleapis.com/plus/v1/people/%@?key=xxxxxxxxxxxxxxxxx",userid]];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url];
[urlRequest setHTTPMethod:@"GET"];
[urlRequest setValue:userid forHTTPHeaderField:@"userId"];
[NSURLConnection sendAsynchronousRequest:urlRequest
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response,
NSData *data,
NSError *connectionError) {
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
NSLog(@"%@",json);
}];
}
我没有启用此应用程序的计费。那么,计费被禁用有什么问题吗?
帮我解决这个问题。
APIs and Auth
overview
链接上方