Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
theLee3 committed Aug 14, 2024
1 parent 09720e8 commit 79c5677
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
10 changes: 9 additions & 1 deletion docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
2 changes: 2 additions & 0 deletions docs/leaderboard_and_achievements.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions docs/player.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions docs/save_load_game.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion games_services/lib/src/achievements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String?> resetAchievements() async {
return await GamesServicesPlatform.instance.resetAchievements();
}
Expand Down

0 comments on commit 79c5677

Please sign in to comment.