java.lang.Object | ||
↳ | com.google.android.gms.common.api.GoogleApi<com.google.android.gms.games.Games.GamesOptions> | |
↳ | com.google.android.gms.games.PlayersClient |
A client to interact with Players.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_PLAYER_SEARCH_RESULTS | Used by the Player Search UI to return a list of parceled Player objects. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
Task which asynchronously loads the current signed-in player ID, if
available. | |||||||||||
Returns a
Task which asynchronously loads annotated PlayerBuffer that
represents players the user has interacted with recently, starting with the most recent. | |||||||||||
Returns a
Task which asynchronously loads an annotated PlayerBuffer that
represents players the user has interacted with recently, starting with the most recent. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Used by the Player Search UI to return a list of parceled Player objects. Retrieve with getParcelableArrayListExtra(String)
.
Returns a Task
which asynchronously loads an Intent
that will display a screen
where the user can compare themselves against another player's profile. Note that the Intent
returned from the Task
must be invoked with startActivityForResult(Intent, int)
, so that the identity of the calling package can
be established.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
player |
Player |
Returns | |
---|---|
Task<Intent> |
Returns a Task
which asynchronously loads the current signed-in Player
, if
available.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Returns | |
---|---|
Task<Player> |
Returns a Task
which asynchronously loads the current signed-in player ID, if
available.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Returns | |
---|---|
Task<String> |
Returns a Task
which asynchronously loads an Intent
that will display a screen
where the user can search for players.
Note that this must be invoked with startActivityForResult(Intent, int)
, so
that the identity of the calling package can be established.
If the user canceled, the result will be RESULT_CANCELED
. If the user
selected any players from the search results list, the result will be RESULT_OK
, and the data intent will contain a list of parceled Player objects in
EXTRA_PLAYER_SEARCH_RESULTS
.
Note that the current Player Search UI only allows a single selection, so the returned list of parceled Player objects will currently contain at most one Player.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Returns | |
---|---|
Task<Intent> |
Returns a Task
which asynchronously loads annotated PlayerBuffer
that
represents players the user has interacted with recently, starting with the most recent.
release()
should be called to release resources after usage.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
pageSize |
int : The number of additional entries to request. This must be a value between 1 and
25.
|
Returns | |
---|---|
Task<AnnotatedData<PlayerBuffer>> |
Returns a Task
which asynchronously loads an annotated Player
profile specified
by playerId
.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
playerId |
String : The player ID to get full profile data for. |
forceReload |
boolean : If true , this call will clear any locally cached data and attempt to
fetch the latest data from the server. This would commonly be used for something like a
user-initiated refresh. Normally, this should be set to false to gain advantages of
data caching.
|
Returns | |
---|---|
Task<AnnotatedData<Player>> |
Returns a Task
which asynchronously loads an annotated Player
profile specified
by playerId
.
Returns the locally cached player if available.
The returned Task
can fail with a RemoteException
.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
playerId |
String : The player ID to get full profile data for.
|
Returns | |
---|---|
Task<AnnotatedData<Player>> |
Returns a Task
which asynchronously loads an annotated PlayerBuffer
that
represents players the user has interacted with recently, starting with the most recent.
release()
should be called to release resources after usage.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
pageSize |
int : The number of entries to request for this initial page. Note that if cached
data already exists, the returned buffer may contain more than this size, but it is
guaranteed to contain at least this many if the collection contains enough records. This
must be a value between 1 and 25. |
forceReload |
boolean : If true , this call will clear any locally cached data and attempt to
fetch the latest data from the server. This would commonly be used for something like a
user-initiated refresh. Normally, this should be set to false to gain advantages of
data caching.
|
Returns | |
---|---|
Task<AnnotatedData<PlayerBuffer>> |