Skip to content

getGameListWithSelectionId:options:completion: ​

获取指定选品单的游戏列表 ​

分页获取指定选品单中的游戏。选品单 ID 可通过 getSelectionListWithOptions:completion: 获取。

调用前须完成 initializeWithConfiguration:completion: 初始化,不要求用户登录。

方法声明 ​

objectivec
+ (void)getGameListWithSelectionId:(NSString *)selectionId
                          options:(nullable SUDOPGameListOptions *)options
                       completion:(nullable void(^)(SUDOPGameListResult *_Nullable result,
                                                     NSError *_Nullable error))completion;

参数与返回值 ​

参数类型必传描述
selectionIdNSString *是选品单 ID,不能为空。
optionsSUDOPGameListOptions *否分页及语言参数。传入 nil 时使用第 0 页、每页 10 条及服务端默认语言。
completionBlock否成功返回 SUDOPGameListResult,失败返回 NSError。

SUDOPGameListOptions、SUDOPGameListResult 和 SUDOPGameListItem 与 原游戏列表接口 相同。

代码示例 ​

objectivec
NSString *selectionId = @"123"; // 替换为实际选品单 ID
SUDOPGameListOptions *options = [[SUDOPGameListOptions alloc] init];
options.language = @"zh-CN";

[SUDOP getGameListWithSelectionId:selectionId
                          options:options
                       completion:^(SUDOPGameListResult * _Nullable result,
                                    NSError * _Nullable error) {
    if (error) {
        NSLog(@"获取选品单游戏失败: %@", error.localizedDescription);
        return;
    }
    NSLog(@"当前选品单的游戏数: %ld", (long)result.total);
}];