【问题标题】:spotify ios sdk contentAPI fetchChildrenOfContentItemspotify ios sdk contentAPI fetchChildrenOfContentItem
【发布时间】:2019-08-10 22:00:09
【问题描述】:

我最近开始使用这个 SDK,我意识到每当我尝试获取一个播放列表曲目时,对该方法的调用将始终获取前 20 个项目,而不管我将其作为参数提供给它的播放列表是什么。我在文档中找不到检索下 20 首曲目等的方法。

你能帮我解决这个问题吗?

非常感谢。

[[self appRemote].contentAPI fetchRootContentItemsForType:SPTAppRemoteContentTypeDefault callback:^(id  _Nullable result, NSError * _Nullable error) {
        [[PPLoader sharedLoader] HideHudLoader];
        if(error!=nil) {
            return;
        }
        NSArray *array = (NSArray*)result;
        NSLog(@"context title: %@", self.playerState.contextTitle);
        for (id<SPTAppRemoteContentItem>item in array) {
            if ([item.title  isEqual: @"Your Library"]) {

                [[self appRemote].contentAPI fetchChildrenOfContentItem:item callback:^(id  _Nullable result, NSError * _Nullable error) {
                    if(error!=nil) {
                        return;
                    }
                    for (id<SPTAppRemoteContentItem>item2 in (NSArray*)result) {
                        if ([item2.title  isEqual: @"Playlists"]) {

                            [[self appRemote].contentAPI fetchChildrenOfContentItem:item2 callback:^(id  _Nullable result, NSError * _Nullable error) {
                                if (error!= nil) {
                                    return;
                                }
                                for(id<SPTAppRemoteContentItem> item3 in (NSArray*)result) {
                                    NSLog(@"item3.title=%@ and self.playerState.contextTitle=%@", item3.title, self.playerState.contextTitle);
                                    if([item3.title isEqualToString:self.playerState.contextTitle]) {
                                        playlist = item3;
                                        [[self appRemote].contentAPI fetchChildrenOfContentItem:playlist callback:^(id  _Nullable result, NSError * _Nullable error) {
                                            if (error != nil) {
                                                return;
                                            }
                                            //arrMusicList = (NSMutableArray*)result;
                                            [arrMusicList addObjectsFromArray:(NSMutableArray*)result];

                                            compBlock(YES);
                                            [tblList reloadData];
                                        }];
                                        break;
                                    }
                                }
                            }];

                        }

                    }

                }];
                break;
            }
        }
    }];

【问题讨论】:

  • 请分享fetchChildrenOfContentItem相关的代码
  • 完成!抱歉耽搁了。
  • 实际上,即使我在某些地方卡住了,这就是为什么如果您在 GitHub 中分享您的代码或添加演示,那将非常有帮助。谢谢

标签: ios objective-c sdk spotify


【解决方案1】:

我也有同样的问题。 在github中输入了一个问题,即限制为20个结果。 :-(

https://github.com/spotify/ios-sdk/issues/172

如果您知道解决方法,请告诉我。

【讨论】:

    猜你喜欢
    • 2014-09-10
    • 2015-03-25
    • 1970-01-01
    • 2014-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-11
    • 2015-08-10
    相关资源
    最近更新 更多