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
| Parameter | Type | Required | Description |
|---|---|---|---|
| options | SUDOPSelectionListOptions * | No | Pagination and language options. Pass nil for page 0, 10 records per page, and the server default language. |
| completion | Block | No | Returns result on success or error on failure. |
SUDOPSelectionListOptions
| Field | Type | Default | Description |
|---|---|---|---|
| pageNo | NSInteger | 0 | Zero-based page number. Values below 0 are treated as 0. |
| pageSize | NSInteger | 10 | Records per page. Values less than or equal to 0 are treated as 10. |
| language | NSString * | nil | Optional BCP 47 language tag, such as en-US. nil or an empty string uses the server default. |
SUDOPSelectionListResult Result Model
| Field | Type | Description |
|---|---|---|
| pageNo | NSInteger | Current zero-based page number. |
| pageSize | NSInteger | Records per page. |
| total | NSInteger | Total number of selections. |
| records | NSArray<SUDOPSelectionListItem *> * | Selections on the current page. |
SUDOPSelectionListItem
| Field | Type | Description |
|---|---|---|
| selectionId | NSString * | Selection ID. |
| name | NSDictionary<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);
}
}];