getGameInformation
Get Game Information
The getGameInformation method retrieves information for the specified game. You can pass a BCP 47 language tag or use the overload that accepts only the game ID and a result listener.
Prerequisites
Before calling getGameInformation, you must call SUDOP.initSDK and wait for initialization to succeed. This requirement applies to both overloads.
Method Declaration
/**
* Get game information
*
* @param gameID Game ID
* @param language BCP 47 language tag
* @param listener Listener for the game information retrieval result
*/
public static void getGameInformation(String gameID, String language, SUDOPGetGameInformationListener listener);
/**
* Get game information without specifying a language
*
* @param gameID Game ID
* @param listener Listener for the game information retrieval result
*/
public static void getGameInformation(String gameID, SUDOPGetGameInformationListener listener);If you do not need to specify a language, use the overload without the language parameter.
Parameters
| Parameter | Type | Description |
|---|---|---|
| gameID | String | The ID of the game to retrieve information for. |
| language | String | A BCP 47 language tag, such as zh-CN or en-US. To leave the language unspecified, use the overload without this parameter. |
| listener | SUDOPGetGameInformationListener | Listener that receives the game information retrieval result. |
Result Listener
public interface SUDOPGetGameInformationListener {
void onSuccess(SUDOPGameInformationModel model);
void onFailure(int retCode, String retMsg);
}| Method | Parameter | Type | Description |
|---|---|---|---|
| onSuccess | model | SUDOPGameInformationModel | The game information object returned on success. Its fields are described below. |
| onFailure | retCode | int | The error code returned on failure. |
| onFailure | retMsg | String | The error description returned on failure. |
Response Model: SUDOPGameInformationModel
| Field | Type | Description |
|---|---|---|
| game_id | String | Game ID. |
| game_name | Map<String, String> | Game name in multiple languages. |
| game_icon | String | Game icon URL. |
| icon | Map<String, String> | Game icon URLs by language. |
| game_introduction | Map<String, String> | Brief game introduction in multiple languages. |
| game_description | Map<String, String> | Detailed game description in multiple languages. |
| category | int | Game category: 1-Role-playing, 2-Management and strategy, 3-Casual and puzzle, 4-Action and adventure, 5-Shooting, 6-Sports and racing, 7-Board and card games, 8-Music and dance. |
| service_phone | String | Customer service phone number. |
| service_email | String | Customer service email address. |
| subject_type | int | Verification type: 0-Individual, 1-Enterprise. |
| subject_name | String | Verified entity: full company name or individual name. |
| privacy_policy_url | String | Privacy policy URL. |
| privacyPolicy | Map<String, String> | Privacy policy URLs by language. |
| version | String | Game version number. |
| update_time | long | Update timestamp in milliseconds. |
Every Map<String, String> field contains at least a default key, whose value is the default value. Other keys are language values (BCP 47 language tags, such as zh-CN or en-US), with each value corresponding to that language.
For example, game_name.get("default") retrieves the default game name, game_name.get("zh-CN") retrieves the Simplified Chinese game name, and icon.get("en-US") retrieves the game icon URL for that English language tag. If the requested language key is absent, you can read the value under default.
Example Code
String gameID = "game_101";
String language = "en-US";
SUDOPGetGameInformationListener listener = new SUDOPGetGameInformationListener() {
@Override
public void onSuccess(SUDOPGameInformationModel model) {
// Read the game name for the language tag
String gameName = model.game_name.get(language);
Log.i("SUDOP", "Game name: " + gameName);
}
@Override
public void onFailure(int retCode, String retMsg) {
Log.e("SUDOP", "Failed to get game information: " + retCode + ", " + retMsg);
}
};
// Specify a language
SUDOP.getGameInformation(gameID, language, listener);
// Leave the language unspecified
SUDOP.getGameInformation(gameID, listener);Notes
To specify a language, pass language between gameID and listener. Otherwise, you can continue using the getGameInformation(gameID, listener) overload.
