Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2025 Developer ToolsGraphics & Games

WWDC25 · 30 min · Developer Tools / Graphics & Games

Get started with Game Center

Explore the features of Game Center and learn how to get started. We’ll show you best practices for implementing achievements, challenges, leaderboards, and activities to maximize your game’s discoverability, attract new players, and increase engagement. To get the most out of this session, we also recommend watching “Engage players with the Apple Games app”.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

Code shown on screen · 7 snippets

Initialize GameKit swift · at 4:17 ↗
GKLocalPlayer.local.authenticateHandler = { _, error in
    print("\(GKLocalPlayer.local.alias) is ready to play!")
}
Initialize GameKit (Unity) csharp · at 4:29 ↗
var player = await GKLocalPlayer.Authenticate();
Debug.Log($"{player.alias} is ready to play!");
Submit score to challenge swift · at 13:07 ↗
// Submit score

GKLeaderboard.submitScore(points, 
         context: 0, 
         player: GKLocalPlayer.local,
         leaderboardIDs: ["thecoast.lb.capecod"])
Activity properties swift · at 20:24 ↗
// Activity properties 

extension AppDelegate: GKLocalPlayerListener {

    func player(_ player: GKPlayer, wantsToPlay activity: GKGameActivity) async -> Bool {
        let activityId = activity.activityDefinition.identifier
        
        if activityId == "thecoast.activity" {
            let level = activity.properties["level"]
            
            if level == "capecod" {
                startCapeCod(activity)
            }
        }
        
        return true
    }

}
Managing score submission with activity swift · at 20:48 ↗
// Managing score submission with activity 

class GameplayManager {
    let activity: GKGameActivity
    let leaderboard: GKLeaderboard
    
    init(activity: GKGameActivity, leaderboard: GKLeaderboard) {
        self.activity = activity
        self.leaderboard = leaderboard
        
        activity.start()
    }
    
    func setScore(_ newScore: Int) {
        activity.setScore(on: leaderboard, to: newScore)
    }

    deinit {
        activity.end()
    }
}
Access the Party Code swift · at 22:35 ↗
extension AppDelegate: GKLocalPlayerListener {
    func player(_ player: GKPlayer, wantsToPlay activity: GKGameActivity) async -> Bool {
        let activityId = activity.activityDefinition.identifier
        
        if activityId == "thecoast.multiplayer" {
            startMultiplayer(partyCode: activity.partyCode)
        }
        
        return true
    }
}
Game Center Matchmaking swift · at 22:48 ↗
let match = try await activity.findMatch()

Resources