# Share leaderboards and achievements between your games

> Have an Agent make a Game Center group, put two or more of your games in it, and give the group leaderboards and achievements that every game in it shares.

Source: https://air.build/docs/app-store/share-game-center-between-your-games/

A Game Center group lets two or more of your games share leaderboards, achievements, challenges and activities, for example a free and a paid edition of the same game. Apple's help says an app can belong to only one group, and that a group can mix apps for different platforms, such as an iOS app and a macOS app. See Apple's [Overview of Game Center groups](https://developer.apple.com/help/app-store-connect/configure-game-center/overview-of-game-center-groups).

> [!NOTE]
> AirBuild has no Game Center screen. You ask an Agent in the Project's chat, and it uses `asc game-center groups` and `asc game-center details` (listed under `game-center` in [asc: apps and App Store listing](https://air.build/docs/cli/asc-apps/#game-center)). To see the result, ask the Agent or open your apps in App Store Connect.

## Before you ask

- Each game needs Game Center. See [Add Game Center leaderboards and achievements](https://air.build/docs/app-store/add-game-center-leaderboards/).
- The games must be apps in the Apple team your Agents use. `asc` works with the Apple teams the Team owner connected in AirBuild. See [Connect your Apple Developer account](https://air.build/docs/app-store/connect-apple-developer-account/).
- `asc` can put a game into a group, but its help shows no way to take a game out again. Apple's [Manage groups](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-groups) describes when and how an app can leave a group in App Store Connect on the web.
- If your games already have leaderboards or achievements of their own, the `asc` help doesn't say what happens to them when a game joins a group. In App Store Connect on the web, Apple walks you through choosing which ones the group keeps; see [Manage groups](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-groups). You may prefer to move such games there.

## Make the group

Ask in either game's Project chat, and name both games, for example:

```text
Make a Game Center group called "Fox Run games" and put Fox Run and Fox Run Lite in it.
```

1. The Agent creates the group with `asc game-center groups create`. The group's reference name is for you; players don't see it.
2. For each game, it puts the game's Game Center setup into the group with `asc game-center details update --game-center-group-id`.
3. It checks which games are in the group with `asc game-center groups details list` and tells you in the chat.

## Add shared leaderboards and achievements

Ask for them the way you would for one game, and say they're for the group, for example:

```text
Add a shared leaderboard for the best score, highest first, to the Fox Run games group, and an achievement for the first win. Then update both games to use them.
```

- The Agent creates them with `--group-id`, for example `asc game-center leaderboards create --group-id`. Challenges, activities and leaderboard sets can belong to a group the same way.
- A group's leaderboards and achievements have their own IDs, which start with `grp.`. `asc` refuses one without it.
- Each game's code reports scores and achievements by their IDs, so each game needs a change to use the group's ones. The Agent can make it in each game's Project.

To see what the group holds, ask "What's in the Fox Run games group?". The Agent lists it with `asc game-center groups leaderboards list`, `achievements list`, `leaderboard-sets list`, `activities list` and `challenges list`.

### What else you can set

| Choice | How |
| --- | --- |
| Which leaderboards or achievements belong to the group | `asc game-center groups leaderboards set` or `achievements set`. Each replaces the group's whole list with the one given, so it needs `--confirm` and the Agent asks you first. Say the full list. |
| Which group leaderboard a game shows first | `asc game-center details update --default-group-leaderboard-v2-id`, for each game. |
| The group's reference name | `asc game-center groups update`. |

## Ship the games

New group leaderboards and achievements go to App Review like a single game's: ask the Agent to add them to your next App Review submission (`asc review items add`), then submit as usual. See [Submit to App Review and release](https://air.build/docs/app-store/submit-for-review/#submit-a-version).

Apple's [Overview of Game Center groups](https://developer.apple.com/help/app-store-connect/configure-game-center/overview-of-game-center-groups) explains what goes live with each game's version and what stays live without one.

## Questions

**Can a game be in two groups?**

No. Apple's help says an app can belong to only one group.

**Can I take a game out of the group?**

`asc` has no command for it. Apple's [Manage groups](https://developer.apple.com/help/app-store-connect/configure-game-center/manage-groups) describes removing an app from a group in App Store Connect on the web, and when that's possible.

**The Agent says the ID must start with grp.**

`asc` stops with `--vendor-id must start with "grp." when using --group-id`. Leaderboards, achievements, challenges, activities and sets made for a group need an ID that starts with `grp.`. Ask the Agent to try again with one.

**Can I delete the group?**

Ask the Agent. `asc game-center groups delete` needs `--confirm`, so it asks you first. `asc` has no command to bring a deleted group back.

**Can players of the two games play online together?**

That's set per game version as multiplayer compatibility in App Store Connect; `asc` can list it but not set it. See Apple's [Add multiplayer compatibility](https://developer.apple.com/help/app-store-connect/configure-game-center/add-multiplayer-compatibility), and [Match players for online play with Game Center](https://air.build/docs/app-store/match-players-for-multiplayer/).
