A client for recording player game events.
To get an instance of this client, use
PlayGames.getGameStatsClient(android.app.Activity)
Public Method Summary
| abstract void | |
| abstract Task<Void> | |
| abstract void | |
| abstract Task<Void> |
recordEventsImmediate(List<PlayerGameEvent>
events)
Records a list of player game events immediately.
|
| abstract void |
requestEventsUpload()
Requests an upload of player game events.
|
Public Methods
public abstract void recordEvent (PlayerGameEvent event)
Records a single player game event.
This method operates in a "fire-and-forget" manner. The event is buffered locally
for background upload. Note that the event may not be sent to the server until the next
scheduled sync. See
requestEventsUpload() if you need to trigger an upload of buffered
events.
Parameters
| event | The player game event to record. |
|---|
public abstract Task<Void> recordEventImmediate (PlayerGameEvent event)
Records a single player game event immediately.
This method attempts to record the event locally and completes the returned
Task when the
local write is successful. Note that the event is still buffered locally for background
upload. See
requestEventsUpload() if you need to trigger an upload.
Parameters
| event | The player game event to record. |
|---|
Returns
- A Task that completes when the event has been recorded locally.
public abstract void recordEvents (List<PlayerGameEvent> events)
Records a list of player game events.
This method operates in a "fire-and-forget" manner. The events are buffered locally
for background upload. Note that the events may not be sent to the server until the
next scheduled sync. See
requestEventsUpload() if you need to trigger an upload of buffered
events.
Batching events into a list is more efficient than calling
recordEvent(PlayerGameEvent) multiple times in rapid succession.
Parameters
| events | A list of player game events to record. |
|---|
public abstract Task<Void> recordEventsImmediate (List<PlayerGameEvent> events)
Records a list of player game events immediately.
This method attempts to record the events locally and completes the returned
Task when the
local write is successful. Note that the events are still buffered locally for
background upload. See
requestEventsUpload() if you need to trigger an upload.
Parameters
| events | A list of player game events to record. |
|---|
Returns
- A Task that completes when the events have been recorded locally.
public abstract void requestEventsUpload ()
Requests an upload of player game events.
This method operates in a "fire-and-forget" manner. It requests an asynchronous background upload of all locally buffered events. Locally stored events are cleared upon successful upload.