Skip to content

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 ​

java
/**
 * 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 ​

ParameterTypeDescription
gameIDStringThe ID of the game to retrieve information for.
languageStringA BCP 47 language tag, such as zh-CN or en-US. To leave the language unspecified, use the overload without this parameter.
listenerSUDOPGetGameInformationListenerListener that receives the game information retrieval result.

Result Listener ​

java
public interface SUDOPGetGameInformationListener {
    void onSuccess(SUDOPGameInformationModel model);
    void onFailure(int retCode, String retMsg);
}
MethodParameterTypeDescription
onSuccessmodelSUDOPGameInformationModelThe game information object returned on success. Its fields are described below.
onFailureretCodeintThe error code returned on failure.
onFailureretMsgStringThe error description returned on failure.

Response Model: SUDOPGameInformationModel ​

FieldTypeDescription
game_idStringGame ID.
game_nameMap<String, String>Game name in multiple languages.
game_iconStringGame icon URL.
iconMap<String, String>Game icon URLs by language.
game_introductionMap<String, String>Brief game introduction in multiple languages.
game_descriptionMap<String, String>Detailed game description in multiple languages.
categoryintGame 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_phoneStringCustomer service phone number.
service_emailStringCustomer service email address.
subject_typeintVerification type: 0-Individual, 1-Enterprise.
subject_nameStringVerified entity: full company name or individual name.
privacy_policy_urlStringPrivacy policy URL.
privacyPolicyMap<String, String>Privacy policy URLs by language.
versionStringGame version number.
update_timelongUpdate 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 ​

java
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.