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
| Field | Type | Default | Description |
|---|---|---|---|
| rankId | NSString * | nil | Required. A non-empty ranking ID passed through as a string. |
| pageNo | NSInteger | 0 | Zero-based page number. Negative values are treated as 0. |
| pageSize | NSInteger | 10 | Records per page. Values less than or equal to 0 are treated as 10. |
| language | NSString * | nil | Language 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
niloptions object or a missing, empty, or whitespace-onlyrankIdreturns a parameter error.
