callback);
///
/// Returns whether or not user is authenticated.
///
/// true if the user is authenticated; otherwise, false.
bool IsAuthenticated();
///
/// Requests server-side access to Player Games Services for the currently signed in player.
///
/// When requested an authorization code is returned that can be used by your game-server to
/// exchange for an access token and conditionally a refresh token (when {@code forceRefreshToken}
/// is true). The access token may then be used by your game-server to access the Play Games
/// Services web APIs. This is commonly used to complete a sign-in flow by verifying the Play Games
/// Services player id.
///
/// If {@code forceRefreshToken} is true, when exchanging the authorization code a refresh token
/// will be returned in addition to the access token. The refresh token allows the game-server to
/// request additional access tokens, allowing your game-server to continue accesses Play Games
/// Services while the user is not actively playing your app.
///
///
///
/// If {@code true} when the returned authorization code is exchanged a
/// refresh token will be included in addition to an access token.
///
void RequestServerSideAccess(bool forceRefreshToken, Action callback);
///
/// Requests Recall Access to Player Games Services for the currently signed in account
///
/// When requested a session id is returned that can be used by your game-server to
/// use Recall Access APIs like LinkPerson , UnlinkPersona and get Details about Recall Tokens
/// and corresponding personas. See https://developer.android.com/games/pgs/recall?hl=en.
///
///
///
///
///
void RequestRecallAccessToken(Action callback);
///
/// Returns the authenticated user's ID. Note that this value may change if a user signs
/// out and signs in with a different account.
///
/// The user's ID, null if the user is not logged in.
string GetUserId();
///
/// Loads friends of the authenticated user. This loads the entire list of friends.
///
/// Callback invoked when complete. bool argument
/// indicates success.
void LoadFriends(Action callback);
///
/// Returns a human readable name for the user, if they are logged in.
///
/// The user's human-readable name. null if they are not logged
/// in
string GetUserDisplayName();
///
/// Returns the user's avatar url, if they are logged in and have an avatar.
///
/// The URL to load the avatar image. null if they are not logged
/// in
string GetUserImageUrl();
/// Gets the player stats.
/// Callback for response.
void GetPlayerStats(Action callback);
///
/// Loads the users specified. This is mainly used by the leaderboard
/// APIs to get the information of a high scorer.
///
/// User identifiers.
/// Callback.
void LoadUsers(string[] userIds, Action callback);
///
/// Loads the achievements for the current signed in user and invokes
/// the callback.
///
void LoadAchievements(Action callback);
///
/// Unlocks the achievement with the passed identifier.
///
/// If the operation succeeds, the callback
/// will be invoked on the game thread with true. If the operation fails, the
/// callback will be invoked with false. This operation will immediately fail if
/// the user is not authenticated (i.e. the callback will immediately be invoked with
/// false). If the achievement is already unlocked, this call will
/// succeed immediately.
///
/// The ID of the achievement to unlock.
/// Callback used to indicate whether the operation
/// succeeded or failed.
void UnlockAchievement(string achievementId, Action successOrFailureCalllback);
///
/// Reveals the achievement with the passed identifier.
///
/// If the operation succeeds, the callback
/// will be invoked on the game thread with true. If the operation fails, the
/// callback will be invoked with false. This operation will immediately fail if
/// the user is not authenticated (i.e. the callback will immediately be invoked with
/// false). If the achievement is already in a revealed state, this call will
/// succeed immediately.
///
/// The ID of the achievement to reveal.
/// Callback used to indicate whether the operation
/// succeeded or failed.
void RevealAchievement(string achievementId, Action successOrFailureCalllback);
///
/// Increments the achievement with the passed identifier.
///
/// If the operation succeeds, the
/// callback will be invoked on the game thread with true. If the operation
/// fails, the callback will be invoked with false. This operation will
/// immediately fail if the user is not authenticated (i.e. the callback will immediately be
/// invoked with false).
///
/// The ID of the achievement to increment.
/// The number of steps to increment by.
/// Callback used to indicate whether the operation
/// succeeded or failed.
void IncrementAchievement(string achievementId, int steps,
Action successOrFailureCalllback);
///
/// 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.
///
/// Ach identifier.
/// Steps.
/// Callback.
void SetStepsAtLeast(string achId, int steps, Action callback);
///
/// Shows the appropriate platform-specific achievements UI.
/// The callback to invoke when complete. If null,
/// no callback is called.
///
void ShowAchievementsUI(Action callback);
///
/// Shows the appropriate platform-specific friends sharing UI.
/// The callback to invoke when complete. If null,
/// no callback is called.
///
void AskForLoadFriendsResolution(Action callback);
///
/// Returns the latest LoadFriendsStatus obtained from loading friends.
///
LoadFriendsStatus GetLastLoadFriendsStatus();
///
/// Shows the Play Games Player Profile UI for a specific user identifier.
///
/// User Identifier.
///
/// The game's own display name of the player referred to by userId.
///
///
/// The game's own display name of the current player.
///
/// Callback invoked upon completion.
void ShowCompareProfileWithAlternativeNameHintsUI(
string otherUserId, string otherPlayerInGameName, string currentPlayerInGameName,
Action callback);
///
/// Returns if the user has allowed permission for the game to access the friends list.
///
/// If true, this call will clear any locally cached data and
/// attempt to fetch the latest data from the server. Normally, this should be set to {@code
/// false} to gain advantages of data caching. Callback
/// invoked upon completion.
void GetFriendsListVisibility(bool forceReload, Action callback);
///
/// Loads the first page of the user's friends
///
///
/// 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.
///
///
/// 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 {@code false} to gain advantages
/// of data caching.
/// Callback invoked upon completion.
void LoadFriends(int pageSize, bool forceReload, Action callback);
///
/// Loads the friends list page
///
///
/// The number of entries to request for this 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.
///
///
void LoadMoreFriends(int pageSize, Action callback);
///
/// Shows the leaderboard UI for a specific leaderboard.
///
/// If the passed ID is null, all leaderboards are displayed.
///
/// The leaderboard to display. null to display
/// all.
/// Timespan to display for the leaderboard
/// If non-null, the callback to invoke when the
/// leaderboard is dismissed.
///
void ShowLeaderboardUI(string leaderboardId, LeaderboardTimeSpan span,
Action callback);
///
/// Loads the score data for the given leaderboard.
///
/// Leaderboard identifier.
/// Start indicating the top scores or player centric
/// max number of scores to return. non-positive indicates
/// no rows should be returned. This causes only the summary info to
/// be loaded. This can be limited
/// by the SDK.
/// leaderboard collection: public or social
/// leaderboard timespan
/// callback with the scores, and a page token.
/// The token can be used to load next/prev pages.
void LoadScores(string leaderboardId, LeaderboardStart start, int rowCount,
LeaderboardCollection collection, LeaderboardTimeSpan timeSpan,
Action callback);
///
/// Loads the more scores for the leaderboard.
///
/// The token is accessed
/// by calling LoadScores() with a positive row count.
///
/// Token for tracking the score loading.
/// max number of scores to return.
/// This can be limited by the SDK.
/// Callback.
void LoadMoreScores(ScorePageToken token, int rowCount,
Action callback);
///
/// Returns the max number of scores returned per call.
///
/// The max results.
int LeaderboardMaxResults();
///
/// Submits the passed score to the passed leaderboard.
///
/// This operation will immediately fail
/// if the user is not authenticated (i.e. the callback will immediately be invoked with
/// false).
///
/// Leaderboard identifier.
/// Score.
/// Callback used to indicate whether the operation
/// succeeded or failed.
void SubmitScore(string leaderboardId, long score, Action successOrFailureCalllback);
///
/// Submits the score for the currently signed-in player.
///
/// Score.
/// leaderboard id.
/// metadata about the score.
/// Callback upon completion.
void SubmitScore(string leaderboardId, long score, string metadata,
Action successOrFailureCalllback);
///
/// Gets the saved game client.
///
/// The saved game client.
SavedGame.ISavedGameClient GetSavedGameClient();
///
/// Gets the events client.
///
/// The events client.
Events.IEventsClient GetEventsClient();
IUserProfile[] GetFriends();
}
}
#endif