getGameInformationWithGameID:language:completion:
Get Game Information
The getGameInformationWithGameID method retrieves detailed information for a specified game. You can pass a BCP 47 language tag or use the overload without the language parameter.
Prerequisite
Call initializeWithConfiguration:completion: and wait for the SDK to initialize successfully before calling this method.
Method Declarations
objectivec
+ (void)getGameInformationWithGameID:(nonnull NSString *)gameID
language:(nonnull NSString *)language
completion:(nullable void(^)(SUDOPGameInformation *_Nullable gameInformation,
NSError *_Nullable error))completion;
+ (void)getGameInformationWithGameID:(nonnull NSString *)gameID
completion:(nullable void(^)(SUDOPGameInformation *_Nullable gameInformation,
NSError *_Nullable error))completion;Use the overload without language when you do not need to select a language. The SDK prefers the system's first preferred language and falls back to en when no preferred language is available.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| gameID | NSString * | Yes | The unique game identifier. Must not be nil. |
| language | NSString * | Yes | A BCP 47 language tag, such as zh-CN or en-US. Use the overload without this parameter when no language needs to be specified. |
| completion | Block | No | Called when the request finishes. On success, it returns gameInformation; on failure, it returns error. The callback runs on the main thread. |
SUDOPGameInformation Result Model
| Field | Type | Description |
|---|---|---|
| gameID | NSString * | Game ID. |
| gameName | NSDictionary<NSString *, NSString *> * | Localized game names. |
| gameIcon | NSString * | Game icon URL. |
| icon | NSDictionary<NSString *, NSString *> * | Localized game icon URLs. |
| gameIntroduction | NSDictionary<NSString *, NSString *> * | Localized game introductions. |
| gameDescription | NSDictionary<NSString *, NSString *> * | Localized game descriptions. |
| category | NSInteger | Game category: 1-RPG, 2-strategy and management, 3-casual and puzzle, 4-action and adventure, 5-shooter, 6-sports and racing, 7-card and board, 8-music and dance. |
| servicePhone | NSString * | Customer service phone number. |
| serviceEmail | NSString * | Customer service email address. |
| subjectType | NSInteger | Subject type: 0-individual, 1-enterprise. |
| subjectName | NSString * | Full enterprise name or individual name. |
| privacyPolicyUrl | NSString * | Privacy policy URL. |
| privacyPolicy | NSDictionary<NSString *, NSString *> * | Localized privacy policy URLs. |
| packageMd5 | NSString * | MD5 checksum of the game package. |
| version | NSString * | Game version. |
| updateTime | long long | Last update timestamp in milliseconds. |
Each localized dictionary contains at least a default key whose value is the default content. Other keys are BCP 47 language tags. If the requested language is unavailable, read the value for default.
Example
objectivec
NSString *gameID = @"game_101";
NSString *language = @"zh-CN";
[SUDOP getGameInformationWithGameID:gameID
language:language
completion:^(SUDOPGameInformation * _Nullable gameInformation,
NSError * _Nullable error) {
if (error) {
NSLog(@"Failed to get game information: %@", error.localizedDescription);
return;
}
NSString *gameName = gameInformation.gameName[language]
?: gameInformation.gameName[@"default"];
NSLog(@"Game name: %@", gameName);
}];
// Omit the language to use the system's preferred language
[SUDOP getGameInformationWithGameID:gameID completion:nil];Notes
gameIDis required. Do not passnilor an empty string.- This method performs a network request. Handle the result asynchronously in
completion. - When specifying
language, pass a valid BCP 47 language tag. - If
erroris returned, check the network, game ID, and the game's console configuration.
