【问题标题】:iOS YouTube "No Filters Selected"iOS YouTube“未选择过滤器”
【发布时间】:2013-08-06 23:24:41
【问题描述】:

我正在尝试使用 YouTube iOS SDK 请求 playListItems。

我返回一个错误...

Error Domain=com.google.GTLJSONRPCErrorDomain
Code=-32602 "The operation couldn’t be completed. (No filter selected.)" 
UserInfo=0x1568f1e0
{
    error=No filter selected.,
    GTLStructuredError=GTLErrorObject 0x1567fdf0: {message:"No filter selected." code:-32602 data:[1]},
    NSLocalizedFailureReason=(No filter selected.)
}

我正在使用的查询是这样的......

GTLServiceYouTube *service = [[GTLServiceYouTube alloc] init];

service.APIKey = @"my key";

// I suspect the problem is here...
GTLQueryYouTube *query = [GTLQueryYouTube queryForPlaylistItemsListWithPart:@"contentDetails"];
query.q = @"playlistId=<The playlist ID>";

GTLServiceTicket *ticket = [service executeQuery:query
                               completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
                                   if (!error) {
                                       GTLYouTubePlaylistItemListResponse *playlistItems = object;

                                       for (GTLYouTubePlaylistItem *playlistItem in playlistItems) {
                                           GTLYouTubePlaylistItemContentDetails *details = playlistItem.contentDetails;

                                           NSLog(@"PlaylistItem video ID = %@", details.videoId);
                                       }
                                   } else {
                                       NSLog(@"%@", error);
                                   }
                               }];

问题在于整个 API 的文档是无用的,因此没有使用此示例的示例。我不得不将 Google Shopping api 和其他东西的示例放在一起。

大部分猜测工作来自here

我应该在query.q 值中添加什么?或者如果我还缺少其他东西?

【问题讨论】:

    标签: ios objective-c youtube


    【解决方案1】:

    好的,我终于找到了一个链接。

    要使用的代码是...

    query.playlistId = @"the playlist ID";
    

    然后一切正常:D

    【讨论】:

      猜你喜欢
      • 2013-05-20
      • 2015-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-31
      • 2020-07-21
      相关资源
      最近更新 更多