Skip to content

getGameListByRankIdWithOptions:completion: ​

Get Games by Ranking ID ​

Retrieves a page of games for a ranking. Initialize the SDK first and obtain ranking IDs from getRankingsListWithOptions:completion:. This method requests /v1/game/getListByRankId.


Method Declaration ​

objectivec
+ (void)getGameListByRankIdWithOptions:(nullable SUDOPGameListByRankIdOptions *)options
                            completion:(nullable void(^)(SUDOPGameListByRankIdResult *_Nullable result,
                                                          NSError *_Nullable error))completion;

SUDOPGameListByRankIdOptions ​

FieldTypeDefaultDescription
rankIdNSString *nilRequired. A non-empty ranking ID passed through as a string.
pageNoNSInteger0Zero-based page number. Negative values are treated as 0.
pageSizeNSInteger10Records per page. Values less than or equal to 0 are treated as 10.
languageNSString *nilLanguage identifier. nil or empty uses the server default.

On success, completion returns SUDOPGameListByRankIdResult with pageNo, pageSize, total, and records. Records use the SUDOPGameListItem model.


Example ​

objectivec
SUDOPGameListByRankIdOptions *options = [[SUDOPGameListByRankIdOptions alloc] init];
options.rankId = @"popular";
options.pageNo = 0;
options.pageSize = 20;
options.language = @"en-US";

[SUDOP getGameListByRankIdWithOptions:options
                           completion:^(SUDOPGameListByRankIdResult * _Nullable result,
                                        NSError * _Nullable error) {
    if (error) {
        NSLog(@"Failed to get ranked games: %@", error.localizedDescription);
        return;
    }
    NSLog(@"Total ranked games: %ld", (long)result.total);
}];

Notes ​

  • A nil options object or a missing, empty, or whitespace-only rankId returns a parameter error.