Streaming is available in most browsers,
and in the Developer app.
-
Manage Game Center with the App Store Connect API
Discover how you can use the App Store Connect API to automate your Game Center configurations outside of App Store Connect on the web. Find out how the API can help you create achievements and leaderboards and share them between related games using groups. And learn how to enable and configure matchmaking in multiplayer games.
Resources
Related Videos
Tech Talks
WWDC22
WWDC20
-
Download
Hi, and welcome. My name is Hubert and I'm a software engineer on the App Store Connect team.
Game Center is a great way to keep players engaged with your game. You may already be familiar with how to setup and manage Game Center in App Store Connect. Today, I’m excited to show you how to manage Game Center with the App Store Connect API. Game Center is a new addition to the App Store Connect API. As a developer, you can automate and synchronize your Game Center configurations across multiple platforms. I’ll start by showing you the Game Center resources available in App Store Connect API. Then, I’ll work through an example using the API to automate the creation of a new achievement. I’ll also work through an example where I create a game group with leaderboards that can be shared between apps. And then, I’ll configure multiplayer compatibility to enable matchmaking for a game. Let’s explore Game Center in App Store Connect’s API by taking a look at the core components of Game Center. Game Center focuses on Achievements and Leaderboards to help drive player engagement in games on the app store.
Achievements provide goals for players that encourage them to explore more content in the game. You can see that I need to encounter 4 more mermaids to obtain the Light of Prometheus achievement. Leaderboards enable players to competitively track their progress between friends. In San Francisco Bay, I’m ranked 2 out of my 8 friends, and in order to pass my friend I’ll need to come back into the game to try and beat their score. App Store Connect API relates all game center configurations for an App through a new resource named game center detail. I’ll show you how to use the API to configure new achievements and leaderboards for a game named “The Coast”. Let’s start by setting up a new achievement for “The Coast”. “The Coast” is a game where players can sail in scenic areas. I’ll show you how to create an achievement that is earned the first time a player sails in the game. Before I can create an achievement I need to create a new Game Center Detail resource. This resource is the bridge between an app and an achievement.
In this example, I’m using a POST request to create a Game Center Detail. “The Coast” has an app id of 123 which I’m required to set on the game center detail as a relationship. After the resource is created a new ID for the Game Center Detail will be returned in the response. I’ll use this ID in the next step when I create the achievement.
Now, I can create an achievement that is awarded the first time a player sails. I’ll set the game center details relationship with the id from the previous step.
Creating an achievement also returns with the newly created achievement id. I’ll note this ID down because I need it in the next step when I create localizations for the achievement.
Localizations are required so that players can read and understand the details of an achievement based on their personal settings. This description helps guide players to obtain the achievement in their language.
An achievement can have a localization for each supported language. I’ll create 2 languages for this achievement, one for Canadian English, and one for Canadian French. First, I’ll create the Canadian English localization. Note that I am creating this resource with a relationship to the achievement id from the previous step. Then, I’ll create the Canadian French localization.
And again, I’ll use the same achievement id from the previous step to relate it to the achievement.
Once the localizations are created, I’ll note down the localization id for the Canadian English localization. And the Canadian French localization.
An image in Game Center is the icon for the achievement awarded to the player once the achievement is completed. After creating the localizations, the next step is to add an image for each localization. In this example, Canadian English and Canadian French both have their own image.
I’ll need to make an asset reservation to upload my localization image. This is done by creating an image resource that is related to the Canadian English localization.
The “upload operations” attribute in the response contains the request operations I can use to upload the asset.
I’ll use curl to upload the image file to the URL provided in the upload operations attribute.
After the upload is complete, I can commit the asset reservation by updating the image resource and setting the uploaded attribute to true.
Now that the achievement is setup it’s a good idea to test it in game with test flight. You can learn more about how to use test flight and game center by visiting developer.apple.com/testflight.
I’ve configured my achievement, tested it, and now I’m ready to submit it for review.
I’ll need to create a release resource which attaches my achievement to the game center detail. I’ll also need to enable game center for the next app store version by creating a related game center app version.
Creating a release requires the Game Center Detail relationship, and the Game Center Achievement relationship.
Next, I can create a new game center app version with the enabled attribute set to true and the app store version relationship.
Now, it’s time for me to submit the achievement for review. In App Store Connect on the App Version page, my achievement “First Sail!” is attached to the Prepare for Submission version for my game. This was done when I created the release. I can submit this app store version for review and when it’s approved the achievement will go live! Let’s recap how to setup a new achievement with the App Store Connect API’s Game Center resources. I created a new Game Center Detail as the bridge between my App and an Achievement. And then, I created the achievement along with localizations and images. I verified the new achievement with test flight before creating a release and enabling game center on the app store version.
Now, let’s talk about how to share leaderboards between apps.
“The Coast” is also a multiplayer game with various leaderboards that track player scores. Friends can compete with each other by beating their scores on a leaderboard, and when players overtake friends on leaderboards a notification is triggered which helps drive players back into the game.
In this example, “The Coast” has a new spin-off game named “The Coast - Blood Moon”. I want to create and share a new leaderboard that tracks the total number of times a player has sailed so that players can increase their score while playing in either game.
Previously, I created an achievement with a direct relationship to a Game Center Detail. Leaderboards can also be created with a direct relationship to a Game Center Detail. To share a leaderboard between apps, I can create a game center group as the bridge between a leaderboard and the game center detail.
In this example, I’ll add “The Coast” and “The Coast - Blood Moon” to the same group so they can share a leaderboard.
I’ll start by creating a new game center group. Then, I’ll note down the group ID so I can use it to relate the game center detail and leaderboard.
Next, I’m going to patch the game center detail I created earlier for “The Coast”.
I’ll add a relationship to the game center group that I just created. This step is repeated for “The Coast - Blood Moon”.
Now I can create a simple leaderboard that tracks the total number of times a player has sailed in “The Coast”.
I’ll relate the leaderboard to the game center group so that both games can use the leaderboard. Localizations, images, and releases should also be created for the leaderboard.
Since I have created a new group leaderboard that is used by both games, I no longer need the original leaderboard that tracks the total number of times a player has sailed in the game.
I can use the archive feature to remove the leaderboard from being visible to players in “The Coast”. You can archive an achievement, leaderboard, or leaderboard set.
Using App Store Connect API, I can submit a PATCH request to update the leaderboard.
In the request I’ll set the archived attribute to true, and once the request is complete the leaderboard will no longer be visible to players in the game.
Let’s recap how groups enabled me to share my leaderboard between “The Coast” and its spin-off game “The Coast - Blood Moon”. I created a game center group and related both apps to the group. And then I created the leaderboard in the group along with some localizations and images. Just like achievements, it’s a good idea to use test flight to verify the leaderboard before creating a release for the leaderboard. Because the old leaderboard is no longer needed we can archive it to remove it from the game.
Next, I’ll show you how to enable multiplayer compatibility so that players can race in “The Coast”.
Multiplayer compatibility enables matchmaking and game sessions between players in games. Connecting players with their friends in “The Coast” can help bring new players into the game.
Enabling it is done by specifying game center app versions that are compatible with each other. In this example, I’ll create a multiplayer compatibility relationship from the game center app version 2.0 so that it is compatible to matchmake with versions 1.1 and 1.2 but not 1.0.
I’ve created a POST request to the compatibility versions relationship on the game center app version. The request contains the list of versions that it is compatible with, and players on version 2.0 will now be able to join multiplayer sessions with players on versions 1.1 and 1.2. App Store Connect API’s new Game Center resources are great way to setup and manage configurations for your games on the App Store.
To wrap up, the App Store Connect API’s Game Center resources provide the ability for developers to automate their game center configurations outside of App Store Connect’s web application. These configurations can be written once and synchronized across multiple platforms. Achievements and Leaderboards are the core components of game center that help drive player engagement and both can be shared between multiple apps by utilizing game center groups. Unused components can be archived so that they are removed from the game. And finally, Multiplayer compatibility can be configured to open game sessions with friends.
As always, we welcome any feedback that you may provide on Feedback Assistant. Thanks for watching, and I hope you can make the best use out of App Store Connect API's new Game Center Resources.
-
-
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.