Stay organized with collections
Save and categorize content based on your preferences.
GooglePlayGames.BasicApi.Events.IEventsClient
An interface for interacting with events.
Summary
See online documentation for Events for more information.
All callbacks in this interface must be invoked on the game thread.
Public functions
FetchAllEvents
void FetchAllEvents(
DataSource source,
Action< ResponseStatus, List< IEvent >> callback
)
Fetches all events defined for this game.
Details |
Parameters |
source
|
The source of the event (i.e. whether we can return stale cached values).
|
callback
|
A callback for the results of the request. The passed list will only be non-empty if the request succeeded. This callback will be invoked on the game thread.
|
|
FetchEvent
void FetchEvent(
DataSource source,
string eventId,
Action< ResponseStatus, IEvent > callback
)
Fetches the event with the specified ID.
Details |
Parameters |
source
|
The source of the event (i.e. whether we can return stale cached values).
|
eventId
|
The ID of the event.
|
callback
|
A callback for the result of the event. If the request failed, the passed event will be null. This callback will be invoked on the game thread.
|
|
IncrementEvent
void IncrementEvent(
string eventId,
uint stepsToIncrement
)
Increments the indicated event.
Details |
Parameters |
eventId
|
The ID of the event to increment.
|
stepsToIncrement
|
The number of steps to increment by.
|
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-08 UTC."],[],[],null,["# GooglePlayGames.BasicApi.Events.IEventsClient Interface Reference\n\nGooglePlayGames.BasicApi.Events.IEventsClient\n=============================================\n\nAn interface for interacting with events.\n\nSummary\n-------\n\nSee online [documentation for Events](https://developers.google.com/games/services/common/concepts/events) for more information.\n\nAll callbacks in this interface must be invoked on the game thread.\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [FetchAllEvents](#interface_google_play_games_1_1_basic_api_1_1_events_1_1_i_events_client_1a3a23d38f619261e9284f76fa0ebaa7dc)`(`[DataSource](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1a7b061047c3edf97247d4d1ccd52e2aec)` source, Action\u003c `[ResponseStatus](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1afc173c0f78ea77552386c8f699526dea)`, List\u003c `[IEvent](/games/services/unity/v2/api/interface/google-play-games/basic-api/events/i-event#interface_google_play_games_1_1_basic_api_1_1_events_1_1_i_event)` \u003e\u003e callback)` | `void` Fetches all events defined for this game. |\n| [FetchEvent](#interface_google_play_games_1_1_basic_api_1_1_events_1_1_i_events_client_1a755e6c50c65ec923ff2b7e0189eb62d8)`(`[DataSource](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1a7b061047c3edf97247d4d1ccd52e2aec)` source, string eventId, Action\u003c `[ResponseStatus](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1afc173c0f78ea77552386c8f699526dea)`, `[IEvent](/games/services/unity/v2/api/interface/google-play-games/basic-api/events/i-event#interface_google_play_games_1_1_basic_api_1_1_events_1_1_i_event)` \u003e callback)` | `void` Fetches the event with the specified ID. |\n| [IncrementEvent](#interface_google_play_games_1_1_basic_api_1_1_events_1_1_i_events_client_1a7933bfc76b28da069d7b1b2d1f4e7fd3)`(string eventId, uint stepsToIncrement)` | `void` Increments the indicated event. |\n\nPublic functions\n----------------\n\n### FetchAllEvents\n\n```c#\nvoid FetchAllEvents(\n DataSource source,\n Action\u003c ResponseStatus, List\u003c IEvent \u003e\u003e callback\n)\n``` \nFetches all events defined for this game.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| | `source` | The source of the event (i.e. whether we can return stale cached values). | | `callback` | A callback for the results of the request. The passed list will only be non-empty if the request succeeded. This callback will be invoked on the game thread. | |\n\n### FetchEvent\n\n```c#\nvoid FetchEvent(\n DataSource source,\n string eventId,\n Action\u003c ResponseStatus, IEvent \u003e callback\n)\n``` \nFetches the event with the specified ID.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|-------------------------------------------------------------------------------------------------------------------------------------------------| | `source` | The source of the event (i.e. whether we can return stale cached values). | | `eventId` | The ID of the event. | | `callback` | A callback for the result of the event. If the request failed, the passed event will be null. This callback will be invoked on the game thread. | |\n\n### IncrementEvent\n\n```c#\nvoid IncrementEvent(\n string eventId,\n uint stepsToIncrement\n)\n``` \nIncrements the indicated event.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------------|--------------------------------------| | `eventId` | The ID of the event to increment. | | `stepsToIncrement` | The number of steps to increment by. | |"]]