Create apps that allow players to interact with each other using GameKit.

GameKit Documentation

Posts under GameKit subtopic

Post

Replies

Boosts

Views

Activity

receivedTurnEventForMatch giving stale data
In my turn-based game, I receive GKListener event receivedTurnEventForMatch and decode the match.matchData. On occasion, the matchData is clearly stale and is from the previous turn. If I call the MatchMaker ViewController up and select that same match, the data is not stale, so it's not a matter of not calling endTurn. I have tried both loadMatchWithID and loadMatchesWithCompletionHandler after receiving the receivedTurnEventForMatch, but the data is still stale. Advice?
4
0
1.1k
2w
GKLeaderboard.submitScore succeeds in development but no production users appear on leaderboard
I'm building an iOS word game (Gramfall) and no production App Store users can see their own scores on any leaderboard, despite Game Center authentication succeeding and no errors being thrown. The same code works correctly in development and all 6 leaderboard submissions fire "Score submitted" notifications on my dev device. 6 leaderboards in App Store Connect (3 Classic all-time, 3 Recurring monthly) and all are Live Production App Store users: authenticated, scores submitted, no errors — scores never appear Development build: all 6 submissions confirmed via Settings → Developer → Notify About Score Submissions Affected users cannot see their own score on the leaderboard from their own device. This rules out privacy/visibility restrictions as a player should always see their own score. This suggests submissions are either silently failing or being accepted but not recorded in the production Game Center environment. What we have ruled out Leaderboard ID mismatch (Everything in App Store Connect matches) Authentication failure (GKLocalPlayer.local.isAuthenticated is true, app shows "Connected") All 6 leaderboards load with releaseState(rawValue: 1), isHidden: false Account-level restrictions effectively ruled out as it affects all users, not one account endGame() fires correctly, confirmed in dev Questions Is there a known difference in how GKLeaderboard.submitScore behaves between the sandbox and production Game Center environments that could cause silent failures? Is there any way for a submission to return no error yet still not be recorded in production? Code func submitGameResult(timeSeconds: Int, score: Int, longestWordLength: Int) { guard GKLocalPlayer.local.isAuthenticated else { return } Task { do { try await GKLeaderboard.submitScore(timeSeconds, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.time", "gramfall.lb.time.monthly"]) try await GKLeaderboard.submitScore(score, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.score", "gramfall.lb.score.monthly"]) try await GKLeaderboard.submitScore(longestWordLength, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.longestword", "gramfall.lb.longestword.monthly"]) } catch { print("[GameCenter] submitGameResult failed: \(error)") } } }
0
0
669
1w
receivedTurnEventForMatch giving stale data
In my turn-based game, I receive GKListener event receivedTurnEventForMatch and decode the match.matchData. On occasion, the matchData is clearly stale and is from the previous turn. If I call the MatchMaker ViewController up and select that same match, the data is not stale, so it's not a matter of not calling endTurn. I have tried both loadMatchWithID and loadMatchesWithCompletionHandler after receiving the receivedTurnEventForMatch, but the data is still stale. Advice?
Replies
4
Boosts
0
Views
1.1k
Activity
2w
GKLeaderboard.submitScore succeeds in development but no production users appear on leaderboard
I'm building an iOS word game (Gramfall) and no production App Store users can see their own scores on any leaderboard, despite Game Center authentication succeeding and no errors being thrown. The same code works correctly in development and all 6 leaderboard submissions fire "Score submitted" notifications on my dev device. 6 leaderboards in App Store Connect (3 Classic all-time, 3 Recurring monthly) and all are Live Production App Store users: authenticated, scores submitted, no errors — scores never appear Development build: all 6 submissions confirmed via Settings → Developer → Notify About Score Submissions Affected users cannot see their own score on the leaderboard from their own device. This rules out privacy/visibility restrictions as a player should always see their own score. This suggests submissions are either silently failing or being accepted but not recorded in the production Game Center environment. What we have ruled out Leaderboard ID mismatch (Everything in App Store Connect matches) Authentication failure (GKLocalPlayer.local.isAuthenticated is true, app shows "Connected") All 6 leaderboards load with releaseState(rawValue: 1), isHidden: false Account-level restrictions effectively ruled out as it affects all users, not one account endGame() fires correctly, confirmed in dev Questions Is there a known difference in how GKLeaderboard.submitScore behaves between the sandbox and production Game Center environments that could cause silent failures? Is there any way for a submission to return no error yet still not be recorded in production? Code func submitGameResult(timeSeconds: Int, score: Int, longestWordLength: Int) { guard GKLocalPlayer.local.isAuthenticated else { return } Task { do { try await GKLeaderboard.submitScore(timeSeconds, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.time", "gramfall.lb.time.monthly"]) try await GKLeaderboard.submitScore(score, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.score", "gramfall.lb.score.monthly"]) try await GKLeaderboard.submitScore(longestWordLength, context: 0, player: GKLocalPlayer.local, leaderboardIDs: ["gramfall.lb.longestword", "gramfall.lb.longestword.monthly"]) } catch { print("[GameCenter] submitGameResult failed: \(error)") } } }
Replies
0
Boosts
0
Views
669
Activity
1w