We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesGame ServiceClient APIsGame APIsjos.gamesGameSummaryClient

com.huawei.hms.jos.games.GameSummaryClient

The GameSummaryClient class defines the APIs for obtaining game information.

Public Method Summary

Return

Method

Task<GameSummary>

getLocalGameSummary()

Obtains the information about the current game from the local cache.

Task<GameSummary>

getGameSummary()

Obtains the information about the current game from Huawei game server. If the obtaining fails, the locally cached information is obtained.

Public Methods

public Task<GameSummary> getLocalGameSummary()

Obtains the information about the current game from the local cache asynchronously.

Return Values

Type

Description

Task<GameSummary>

GameSummary object that contains the information about the current game.

You need to set two callback listeners in the Task returned by the API. OnSuccessListener obtains the data returned in the success scenario, and OnFailureListener obtains the information about the request failure. In OnFailureListener, you need to check whether the exception object called back in this mode is an ApiException instance object, and resolve the failure according to getStatusCode() contained in the ApiException instance.

public Task<GameSummary> getGameSummary()

Obtains the information about the current game from Huawei game server asynchronously. If the obtaining fails, the locally cached information is obtained.

Return Values

Type

Description

Task<GameSummary>

The information about the current game.

You need to set two callback listeners in the Task returned by the API. OnSuccessListener obtains the data returned in the success scenario, and OnFailureListener obtains the information about the request failure. In OnFailureListener, you need to check whether the exception object called back in this mode is an ApiException instance object, and resolve the failure according to getStatusCode() contained in the ApiException instance.

This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.