0
我嘗試通過Google API獲取用戶信息。但是 我得到以下錯誤。ios中的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);
}];
}
我不啓用該應用程序計費。那麼,關於計費是否有任何問題是禁用的。
幫我解決這個問題。
謝謝