【发布时间】:2014-01-27 07:35:05
【问题描述】:
我正在使用objective-c google data api 库来尝试访问youtube 数据。我已经设置了一个应用程序,启用了 youtube 数据 api,并创建了一个 ios 特定密钥。但是,每次我尝试访问 api 时,都会收到 403“未配置访问”错误。我也对我的包标识符进行了五次检查。这是我的代码:
service = [[GTLServiceYouTube alloc] init];
service.shouldFetchNextPages = YES;
service.retryEnabled = YES;
service.apiVersion = @"v3";
service.APIKey = @"API KEY GOES HERE"; // proper api key is filled in here
[service executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
id object,
NSError *error) {
if (error == nil) {
GTLYouTubeSearchListResponse *videos = object;
for (GTLYouTubeVideo *video in videos) {
NSLog(@"%@", video);
}
}
else {
NSLog(@"%@", error.description);
}
}];
【问题讨论】:
-
这个问题是内部报告的。您可以通过公共问题跟踪器对其进行跟踪。 code.google.com/p/gdata-issues/issues/detail?id=5770
-
谢谢!在这里记录一下,根据您在问题跟踪器中的消息,我们现在可以通过删除 google api 控制台中的捆绑标识符记录来解决这个问题。请谨慎使用,因为这可能会使您在未经授权的情况下使用您的密钥。
标签: ios objective-c youtube youtube-api google-api