C# Class GooglePlayGames.BasicApi.DummyClient

Inheritance: IPlayGamesClient
Datei anzeigen Open project: playgameservices/play-games-plugin-for-unity Class Usage Examples

Public Methods

Method Description
Authenticate ( string>.Action callback, bool silent ) : void

Starts the authentication process.

If silent == true, no UIs will be shown (if UIs are needed, it will fail rather than show them). If silent == false, this may show UIs, consent dialogs, etc. At the end of the process, callback will be invoked to notify of the result. Once the callback returns true, the user is considered to be authenticated forever after.

GetAccessToken ( ) : string

Returns an access token.

GetAchievement ( string achId ) : GooglePlayGames.BasicApi.Achievement

Returns the achievement corresponding to the passed achievement identifier.

GetApiClient ( ) : IntPtr

Gets the Android API client. Returns null on non-Android players.

GetEventsClient ( ) : GooglePlayGames.BasicApi.Events.IEventsClient

Gets the events client.

GetFriends ( ) : IUserProfile[]

Gets the friends.

GetIdToken ( Action idTokenCallback ) : void

Retrieves an id token, which can be verified server side, if they are logged in.

GetInvitationFromNotification ( ) : Invitation

Gets the invitation from notification.

GetPlayerStats ( PlayerStats>.Action callback ) : void

Gets the player stats.

GetQuestsClient ( ) : GooglePlayGames.BasicApi.Quests.IQuestsClient

Gets the quests client.

GetRtmpClient ( ) : IRealTimeMultiplayerClient

Returns a real-time multiplayer client.

GetSavedGameClient ( ) : SavedGame.ISavedGameClient

Gets the saved game client.

GetServerAuthCode ( string serverClientId, string>.Action callback ) : void

Asynchronously retrieves the server auth code for this client.

Note: This function is only implemented for Android.

GetTbmpClient ( ) : ITurnBasedMultiplayerClient

Returns a turn-based multiplayer client.

GetToken ( ) : string

Retrieves an OAuth 2.0 bearer token for the client.

GetUserDisplayName ( ) : string

Returns a human readable name for the user, if they are logged in.

GetUserEmail ( ) : string

Gets the user's email.

The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.

GetUserEmail ( string>.Action callback ) : void

Gets the user's email with a callback.

The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.

GetUserId ( ) : string

Returns the authenticated user's ID. Note that this value may change if a user signs on and signs in with a different account.

GetUserImageUrl ( ) : string

Returns the user's avatar url, if they are logged in and have an avatar.

HasInvitationFromNotification ( ) : bool

Determines whether this instance has invitation from notification.

IncrementAchievement ( string achId, int steps, Action callback ) : void

Increments the achievement.

IsAuthenticated ( ) : bool

Returns whether or not user is authenticated.

LeaderboardMaxResults ( ) : int

Returns the max number of scores returned per call.

LoadAchievements ( Action callback ) : void

Loads the achievements for the current player.

LoadFriends ( Action callback ) : void

Load friends of the authenticated user

LoadMoreScores ( GooglePlayGames.BasicApi.ScorePageToken token, int rowCount, Action callback ) : void

Loads the more scores for the leaderboard.

The token is accessed by calling LoadScores() with a positive row count.

LoadScores ( string leaderboardId, LeaderboardStart start, int rowCount, LeaderboardCollection collection, LeaderboardTimeSpan timeSpan, Action callback ) : void

Loads the score data for the given leaderboard.

LoadUsers ( string userIds, Action callback ) : void

Loads the players specified.

This is mainly used by the leaderboard APIs to get the information of a high scorer.

RegisterInvitationDelegate ( InvitationReceivedDelegate invitationDelegate ) : void

Registers the invitation delegate.

RevealAchievement ( string achId, Action callback ) : void

Reveals the achievement.

SetStepsAtLeast ( string achId, int steps, Action callback ) : void

Set an achievement to have at least the given number of steps completed.

Calling this method while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement is automatically unlocked, and any further mutation operations are ignored.

ShowAchievementsUI ( Action callback ) : void

Shows the achievements UI

ShowLeaderboardUI ( string leaderboardId, LeaderboardTimeSpan span, Action callback ) : void

Shows the leaderboard UI

SignOut ( ) : void

Signs the user out.

SubmitScore ( string leaderboardId, long score, Action callback ) : void

Submits the score.

SubmitScore ( string leaderboardId, long score, string metadata, Action callback ) : void

Submits the score for the currently signed-in player to the leaderboard associated with a specific id and metadata (such as something the player did to earn the score).

UnlockAchievement ( string achId, Action callback ) : void

Unlocks the achievement.

Private Methods

Method Description
LogUsage ( ) : void

Logs the usage.

Method Details

Authenticate() public method

Starts the authentication process.
If silent == true, no UIs will be shown (if UIs are needed, it will fail rather than show them). If silent == false, this may show UIs, consent dialogs, etc. At the end of the process, callback will be invoked to notify of the result. Once the callback returns true, the user is considered to be authenticated forever after.
public Authenticate ( string>.Action callback, bool silent ) : void
callback string>.Action Callback when completed.
silent bool If set to true silent.
return void

GetAccessToken() public method

Returns an access token.
public GetAccessToken ( ) : string
return string

GetAchievement() public method

Returns the achievement corresponding to the passed achievement identifier.
public GetAchievement ( string achId ) : GooglePlayGames.BasicApi.Achievement
achId string Achievement identifier.
return GooglePlayGames.BasicApi.Achievement

GetApiClient() public method

Gets the Android API client. Returns null on non-Android players.
public GetApiClient ( ) : IntPtr
return System.IntPtr

GetEventsClient() public method

Gets the events client.
public GetEventsClient ( ) : GooglePlayGames.BasicApi.Events.IEventsClient
return GooglePlayGames.BasicApi.Events.IEventsClient

GetFriends() public method

Gets the friends.
public GetFriends ( ) : IUserProfile[]
return IUserProfile[]

GetIdToken() public method

Retrieves an id token, which can be verified server side, if they are logged in.
public GetIdToken ( Action idTokenCallback ) : void
idTokenCallback Action The callback invoked with the token
return void

GetInvitationFromNotification() public method

Gets the invitation from notification.
public GetInvitationFromNotification ( ) : Invitation
return GooglePlayGames.BasicApi.Multiplayer.Invitation

GetPlayerStats() public method

Gets the player stats.
public GetPlayerStats ( PlayerStats>.Action callback ) : void
callback PlayerStats>.Action Callback for response.
return void

GetQuestsClient() public method

Gets the quests client.
public GetQuestsClient ( ) : GooglePlayGames.BasicApi.Quests.IQuestsClient
return GooglePlayGames.BasicApi.Quests.IQuestsClient

GetRtmpClient() public method

Returns a real-time multiplayer client.
public GetRtmpClient ( ) : IRealTimeMultiplayerClient
return IRealTimeMultiplayerClient

GetSavedGameClient() public method

Gets the saved game client.
public GetSavedGameClient ( ) : SavedGame.ISavedGameClient
return SavedGame.ISavedGameClient

GetServerAuthCode() public method

Asynchronously retrieves the server auth code for this client.
Note: This function is only implemented for Android.
public GetServerAuthCode ( string serverClientId, string>.Action callback ) : void
serverClientId string The Client ID.
callback string>.Action Callback for response.
return void

GetTbmpClient() public method

Returns a turn-based multiplayer client.
public GetTbmpClient ( ) : ITurnBasedMultiplayerClient
return ITurnBasedMultiplayerClient

GetToken() public method

Retrieves an OAuth 2.0 bearer token for the client.
public GetToken ( ) : string
return string

GetUserDisplayName() public method

Returns a human readable name for the user, if they are logged in.
public GetUserDisplayName ( ) : string
return string

GetUserEmail() public method

Gets the user's email.
The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.
public GetUserEmail ( ) : string
return string

GetUserEmail() public method

Gets the user's email with a callback.
The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.
public GetUserEmail ( string>.Action callback ) : void
callback string>.Action The callback with a status code of the request, /// and string which is the email. It can be null.
return void

GetUserId() public method

Returns the authenticated user's ID. Note that this value may change if a user signs on and signs in with a different account.
public GetUserId ( ) : string
return string

GetUserImageUrl() public method

Returns the user's avatar url, if they are logged in and have an avatar.
public GetUserImageUrl ( ) : string
return string

HasInvitationFromNotification() public method

Determines whether this instance has invitation from notification.
public HasInvitationFromNotification ( ) : bool
return bool

IncrementAchievement() public method

Increments the achievement.
public IncrementAchievement ( string achId, int steps, Action callback ) : void
achId string Achievement identifier.
steps int Steps to increment by..
callback Action Callback to invoke when complete.
return void

IsAuthenticated() public method

Returns whether or not user is authenticated.
public IsAuthenticated ( ) : bool
return bool

LeaderboardMaxResults() public method

Returns the max number of scores returned per call.
public LeaderboardMaxResults ( ) : int
return int

LoadAchievements() public method

Loads the achievements for the current player.
public LoadAchievements ( Action callback ) : void
callback Action Callback to invoke when completed.
return void

LoadFriends() public method

Load friends of the authenticated user
public LoadFriends ( Action callback ) : void
callback Action Callback invoked when complete. bool argument /// indicates success.
return void

LoadMoreScores() public method

Loads the more scores for the leaderboard.
The token is accessed by calling LoadScores() with a positive row count.
public LoadMoreScores ( GooglePlayGames.BasicApi.ScorePageToken token, int rowCount, Action callback ) : void
token GooglePlayGames.BasicApi.ScorePageToken Token used to start loading scores.
rowCount int Max number of scores to return. /// This can be limited by the SDK.
callback Action Callback to invoke when complete.
return void

LoadScores() public method

Loads the score data for the given leaderboard.
public LoadScores ( string leaderboardId, LeaderboardStart start, int rowCount, LeaderboardCollection collection, LeaderboardTimeSpan timeSpan, Action callback ) : void
leaderboardId string Leaderboard identifier.
start LeaderboardStart Start indicating the top scores or player centric
rowCount int Row count.
collection LeaderboardCollection Collection to display.
timeSpan LeaderboardTimeSpan Time span.
callback Action Callback to invoke when complete.
return void

LoadUsers() public method

Loads the players specified.
This is mainly used by the leaderboard APIs to get the information of a high scorer.
public LoadUsers ( string userIds, Action callback ) : void
userIds string User identifiers.
callback Action Callback to invoke when completed.
return void

RegisterInvitationDelegate() public method

Registers the invitation delegate.
public RegisterInvitationDelegate ( InvitationReceivedDelegate invitationDelegate ) : void
invitationDelegate InvitationReceivedDelegate Invitation delegate.
return void

RevealAchievement() public method

Reveals the achievement.
public RevealAchievement ( string achId, Action callback ) : void
achId string Achievement identifier.
callback Action Callback to invoke when complete.
return void

SetStepsAtLeast() public method

Set an achievement to have at least the given number of steps completed.
Calling this method while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement is automatically unlocked, and any further mutation operations are ignored.
public SetStepsAtLeast ( string achId, int steps, Action callback ) : void
achId string Achievement identifier.
steps int Steps to increment to at least.
callback Action Callback to invoke when complete.
return void

ShowAchievementsUI() public method

Shows the achievements UI
public ShowAchievementsUI ( Action callback ) : void
callback Action Callback to invoke when complete.
return void

ShowLeaderboardUI() public method

Shows the leaderboard UI
public ShowLeaderboardUI ( string leaderboardId, LeaderboardTimeSpan span, Action callback ) : void
leaderboardId string Leaderboard identifier.
span LeaderboardTimeSpan Timespan to display.
callback Action Callback to invoke when complete.
return void

SignOut() public method

Signs the user out.
public SignOut ( ) : void
return void

SubmitScore() public method

Submits the score.
public SubmitScore ( string leaderboardId, long score, Action callback ) : void
leaderboardId string Leaderboard identifier.
score long Score to submit.
callback Action Callback to invoke when complete.
return void

SubmitScore() public method

Submits the score for the currently signed-in player to the leaderboard associated with a specific id and metadata (such as something the player did to earn the score).
public SubmitScore ( string leaderboardId, long score, string metadata, Action callback ) : void
leaderboardId string Leaderboard identifier.
score long Score value to submit.
metadata string Metadata about the score.
callback Action Callback upon completion.
return void

UnlockAchievement() public method

Unlocks the achievement.
public UnlockAchievement ( string achId, Action callback ) : void
achId string Achievement identifier.
callback Action Callback to invoke when complete.
return void