01/10/2025 10:53:00
GameCenter Channel Description
I. Overview
GameCenter is Apple Game Center and is a social channel provided by Apple for the iOS platform. It provides leaderboards and challenges. It can also help lightweight online games manage achievements and leaderboards, thus reducing the developer's workload.
Game Center provides the following mechanisms:
- User Management and Verification: Your game no longer has to consider how to implement user registration, login, password retrieval, storage scores and other cumbersome functions. Game Center provides a local player for your game. This object is shared by all games. You only need to call it;
- Leaderboards: You can easily have one or more leaderboards by specifying the ranking method in iTunesConnect;
- Records and achievements: Your game needs to define milestones and can save progress by calling Game Center.
- Challenges: Game Center provides a mechanism for players to challenge other players.
II. Developer Platform Configuration
2.1 Create iOS App
Log in Apple Developer Center, click [Certificates, IDs & Profiles] tab from the left navigation bar, and follow the instructions to create APP and get Bundle ID
2.2 iTunes Connect configuration
Log in iTunes Connect, Bundle ID gotten according to Step 1 adds iTunes Connect APP Click Feature->GameCenter, enter GameCenter configuration, and enable GameCenter functions; next, the game can set its own leaderboards and achievements.
2.3 Leaderboard and Achievements
Leaderboard's configuration is shown in the following diagram (Achievement's configuration is similar to that of Leaderboard) For each field, click on the file icon behind the input box, and there will be a detailed explanation of it. Among them
- sort Order: The content in the leaderboard is sorted in ascending or descending order.
- Score Format Type: The type of the score.
After the configuration is completed, save it. This completes the configuration of a leaderboard. We can add multiple leaderboards according to our needs. They can support multiple languages. For each language supported, it is needed to complete a language-adding operation.
III. iOS Project Configuration
3.1 Bundle ID
Configure Bundle identifier of Info.plist in the project, making it the same with Bundle ID in iTunes Connect; otherwise, when you try to login GameCenter, an error will be prompted not to support GameCenter.
3.2 Enable Game Center Feature
Select the project target. In the Capabilities tab, enable Game Center section. Xcode will automatically add GameKit.framework to the project's dependency.
3.3 System Library Dependency
- GameKit.framework
IV. Function Description
4.1 Login Function
- After iOS 10, Game Center will continue to exist as a service, but Game Center's standalone app will no longer appear on the user's device. Users can continue to use Game Center's related functions through Configuration->Game Center
In the game, login Game Center. The expression form is mainly divided into the following two types:
Configuration->Game Center Already logged in : execute silent login and pop up the welcome back, xxxx banner. The whole login process will not block the game process;
Configuration->Game Center Not login yet; the login box used to login GameCenter will pop up in the game. After the user cancels the login three times, the GameCenter login box will not be launched again in the game any longer. It is needed to guide the user to return Configuration->Game Center to manually login GameCenter.
V. FAQs
5.1 Cancel GameCenter binding
When Login plugin is bound with GameCenter, the system always returns user cancellation. This is an Apple system limitation. In this case, the user needs to return to the game to bind after configuring manually logging in GameCenter in the cellphone.
5.2 Cancel GameCenter binding
Auth plugin GameCenter provides a silent binding function (retExtraJson->quietConnect, 1 stands for silent binding, 0 stands for manual binding). For silent binding, except for "retCode": 5, "thirdCode": 3 (need to restore operation!), other errors are not handled.
All rights reserved.