Skip to content

getRankingsListWithOptions:completion: ​

Get Game Rankings ​

Retrieves the available game rankings, including localized names, titles, and descriptions. Initialize the SDK before calling this method. It requests /v1/game/getRankingsList.


Method Declaration ​

objectivec
+ (void)getRankingsListWithOptions:(nullable SUDOPRankingsListOptions *)options
                        completion:(nullable void(^)(SUDOPRankingsListResult *_Nullable result,
                                                      NSError *_Nullable error))completion;

Parameters ​

ParameterTypeRequiredDescription
optionsSUDOPRankingsListOptions *NoRanking query options. A nil or empty language uses the server default.
completionBlockNoReturns the rankings on success or an NSError on failure.

Result Models ​

SUDOPRankingsListResult.records is an array of SUDOPRankingsListItem objects:

FieldTypeDescription
rankIdNSString *Ranking ID, preserved as a string.
nameNSDictionary<NSString *, NSString *> *Localized ranking names.
titleNSDictionary<NSString *, NSString *> *Localized ranking titles.
rankingDescriptionNSDictionary<NSString *, NSString *> *Localized descriptions, mapped from the server's description field.

Example ​

objectivec
SUDOPRankingsListOptions *options = [[SUDOPRankingsListOptions alloc] init];
options.language = @"en-US";

[SUDOP getRankingsListWithOptions:options
                       completion:^(SUDOPRankingsListResult * _Nullable result,
                                    NSError * _Nullable error) {
    if (error) {
        NSLog(@"Failed to get rankings: %@", error.localizedDescription);
        return;
    }
    for (SUDOPRankingsListItem *item in result.records) {
        NSLog(@"Ranking ID: %@, name: %@", item.rankId, item.name);
    }
}];

Notes ​

  • Keep rankId as a string; do not convert it through floating-point or narrow integer types.
  • Pass a ranking ID to getGameListByRankIdWithOptions:completion: to retrieve its games.