Skip to content

getSelectionListWithOptions:completion: ​

Get Selection List ​

Retrieve a page of game selections and their localized names. Use a returned selectionId with getGameListWithSelectionId:options:completion: to retrieve games in that selection.

Call after initializeWithConfiguration:completion: succeeds. User authentication is not required.

Method Declaration ​

objectivec
+ (void)getSelectionListWithOptions:(nullable SUDOPSelectionListOptions *)options
                        completion:(nullable void(^)(SUDOPSelectionListResult *_Nullable result,
                                                      NSError *_Nullable error))completion;

Parameters ​

ParameterTypeRequiredDescription
optionsSUDOPSelectionListOptions *NoPagination and language options. Pass nil for page 0, 10 records per page, and the server default language.
completionBlockNoReturns result on success or error on failure.

SUDOPSelectionListOptions ​

FieldTypeDefaultDescription
pageNoNSInteger0Zero-based page number. Values below 0 are treated as 0.
pageSizeNSInteger10Records per page. Values less than or equal to 0 are treated as 10.
languageNSString *nilOptional BCP 47 language tag, such as en-US. nil or an empty string uses the server default.

SUDOPSelectionListResult Result Model ​

FieldTypeDescription
pageNoNSIntegerCurrent zero-based page number.
pageSizeNSIntegerRecords per page.
totalNSIntegerTotal number of selections.
recordsNSArray<SUDOPSelectionListItem *> *Selections on the current page.

SUDOPSelectionListItem ​

FieldTypeDescription
selectionIdNSString *Selection ID.
nameNSDictionary<NSString *, NSString *> *Localized selection names keyed by language tag; default identifies the default name.

Example ​

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

[SUDOP getSelectionListWithOptions:options
                        completion:^(SUDOPSelectionListResult * _Nullable result,
                                     NSError * _Nullable error) {
    if (error) {
        NSLog(@"Failed to get selections: %@", error.localizedDescription);
        return;
    }
    for (SUDOPSelectionListItem *item in result.records) {
        NSLog(@"Selection ID: %@, name: %@", item.selectionId, item.name);
    }
}];