The EventsClient class defines the APIs related to event management, such as submitting event data and obtaining the event data of the current player.
| return type | description |
void | grow(String eventId, int growAmount) Submits the event data of the current player. |
Task<List<Event>> | getEventList(boolean forceReload) Obtains all event data of the current player. |
Task<List<Event>> | getEventListByIds(boolean forceReload, String[] eventIds) Obtains the event data of the current player for specified events. |
Submits event data.
This method submits data asynchronously. That is, if the network is unavailable when the app calls this method, the HMS SDK caches the data locally. After the network is recovered, the HMS SDK submits the data to Huawei server. Developers do not need to pay attention to the execution result of this method.
Input Parameters
| parameter | description |
eventId | ID of the event to be submitted. |
growAmount | Increment amount of the existing event value. |
Obtains all event data of the current player.
Input Parameters
| parameter | description |
forceReload | Indicates whether to load the event list stored on the server or cached locally.
|
Return Values
The list of Event obejct.
Obtains the event data of the current player for specified events. Data of one or more events can be obtained.
Input Parameters
| parameter | description |
forceReload | Indicates whether to load the event list stored on the server or cached locally.
|
eventIds | IDs of the events to be obtained. The value is a string array. |
Return Values
The list of Event obejct.