我最近开始使用此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;
}
}
}];
我遇到了同样的问题。Github中有一个问题,也就是说,它仅限于20个结果。: - (
https://github.com/spotify/ios-sdk/issues/172
让我知道,一旦您知道解决方法。