gpt4 book ai didi

ios - 访问未配置的 YouTube API

转载 作者:可可西里 更新时间:2023-11-01 04:30:08 26 4
gpt4 key购买 nike

我正在尝试将观看来自 YouTube 的某些视频的功能添加到我正在创建的 iOS 应用程序中。正如评论所建议的那样,我有一个来自谷歌的 API key ,并且已经从开发者控制台启用了 YouTube API。这不是问题。

我有一个非常简单的方法,可以从它的 ID 中收集特定 YouTube channel 的详细信息,然后我将使用它来查找所有该 channel 上传的视频。我遇到的问题是它说我的访问权限未配置。这是我所做的一切:

获取信息的方法(显然我没有在其中包含我的 key 或 channel ID):

- (void)collectChannelData {

GTLServiceYouTube *service = [[GTLServiceYouTube alloc] init];
service.APIKey = @"API_KEY";
GTLQueryYouTube *query = [GTLQueryYouTube queryForChannelsListWithPart:@"contentDetails"];
query.channelId = @"CHANNEL_ID";

GTLServiceTicket *ticket = [service executeQuery:query completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
if (!error) {
GTLYouTubeChannelListResponse *channelItem = object;
NSLog(@"%@", channelItem);
} else {
NSLog(@"%@", error);
}
}]; }

我已确保 YouTube 数据 API v3 已在 Google Developer Console 中打开,并且 Bundle Identifier 与我的 Info.plist 中的内容相匹配

我收到的错误信息是:

Error Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The operation couldn’t be completed. (Access Not Configured. Please use Google Developers Console to activate the API for your project.)" UserInfo=0xa3aa0e0 {error=Access Not Configured. Please use Google Developers Console to activate the API for your project., GTLStructuredError=GTLErrorObject 0x8a74630: {message:"Access Not Configured. Please use Google Developers Console to activate the API for your project." code:403 data:[1]}, NSLocalizedFailureReason=(Access Not Configured. Please use Google Developers Console to activate the API for your project.)}

我找不到任何这行不通的原因。我相信我是正确的,因为我不需要为此特定请求设置计费帐户或需要 oAuth。我还可以在 Developer Console 上的应用程序概述中看到已收到多个请求,但每个请求都有一个错误。我只是不明白它为什么拒绝它。

感谢您的帮助。

最佳答案

Bundle 标识符存在一个已知问题,请暂时忽略它,它应该可以工作。

您可以在此处跟踪问题:https://code.google.com/p/gdata-issues/issues/detail?id=5770

关于ios - 访问未配置的 YouTube API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21519644/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com