From 79c5677c8d99b756f9a7021a53a22575bf55321c Mon Sep 17 00:00:00 2001 From: theLee3 <46857988+theLee3@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:01:54 -0400 Subject: [PATCH] Update docs. --- docs/auth.md | 10 +++++++++- docs/leaderboard_and_achievements.md | 2 ++ docs/player.md | 12 ++++++++++++ docs/save_load_game.md | 6 ------ games_services/lib/src/achievements.dart | 2 +- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/auth.md b/docs/auth.md index 23642cc..139131a 100644 --- a/docs/auth.md +++ b/docs/auth.md @@ -13,5 +13,13 @@ Sign the user into Game Center (iOS/macOS) or Google Play Games (Android). This A boolean value to check if the user is currently signed into Game Center or Google Play Games. ```dart -final isSignedIn = GameAuth.isSignedIn; +final isSignedIn = await GameAuth.isSignedIn; +``` + +## Get Auth Code + +Retrieve a Google Play Games `server_auth_code` to be used by a backend, such as Firebase, to authenticate the user. `null` on other platforms. + +```dart +final authCode = await GameAuth.getAuthCode(String clientID); ``` diff --git a/docs/leaderboard_and_achievements.md b/docs/leaderboard_and_achievements.md index 924fb04..e7c82ac 100644 --- a/docs/leaderboard_and_achievements.md +++ b/docs/leaderboard_and_achievements.md @@ -57,6 +57,8 @@ Get leaderboard scores as a list. Use this to build a custom UI. final result = await Leaderboards.loadLeaderboardScores( iOSLeaderboardID: "ios_leaderboard_id", androidLeaderboardID: "android_leaderboard_id", + // Returns a list centered around the player's rank on the leaderboard. (Defaults to false) + playerCentered: false, scope: PlayerScope.global, timeScope: TimeScope.allTime, maxResults: 10); diff --git a/docs/player.md b/docs/player.md index 4d81566..2e20785 100644 --- a/docs/player.md +++ b/docs/player.md @@ -16,6 +16,18 @@ Get the current player's name. This returns the player's alias on iOS/macOS. final playerName = Player.getPlayerName(); ``` +## Player icon image + +Get the player's icon image as a base64 encoded string. + +```dart +// icon-size image +final base64iconImage = await Player.getPlayerIconImage(); + +// hi-res image +final base64hiResImage = await Player.getPlayerHiResImage(); +``` + ## Player score Get the current player's score for a specific leaderboard. diff --git a/docs/save_load_game.md b/docs/save_load_game.md index a7c6312..73ad9dd 100644 --- a/docs/save_load_game.md +++ b/docs/save_load_game.md @@ -23,12 +23,6 @@ Enable saved games support for your game in the Google Play Console: - Turn the `Saved Games` option to `ON`. - Click `Save`. -After that when you sign in make sure to set `shouldEnableSavedGame` to `true`. - -``` dart - GameAuth.signIn(shouldEnableSavedGame: true); -``` - ## Save game Save a game with `data` and a unique `name`. diff --git a/games_services/lib/src/achievements.dart b/games_services/lib/src/achievements.dart index e25b560..a729ecf 100644 --- a/games_services/lib/src/achievements.dart +++ b/games_services/lib/src/achievements.dart @@ -27,7 +27,7 @@ abstract class Achievements { return null; } - /// It will reset the achievements. + /// It will reset the achievements. For use in testing, not published games. static Future resetAchievements() async { return await GamesServicesPlatform.instance.resetAchievements(); }