Question

I've stumbled onto some weird stuff when implementing a a turn-based game with iOS6.

I have created a bunch of matches and the icon of the game says "29". But when running this:

[GKTurnBasedMatch loadMatchesWithCompletionHandler:^(NSArray *matches, NSError *error) {
}];

I get zero matches back and if I try to create a new one I get this error:

Error Domain=GKErrorDomain Code=21

Which points to the new GKErrorTurnBasedTooManySessions

But I can't find those "sessions" and end them!

Was it helpful?

Solution

I have been in discussions with an Apple tech about this problem. This was their description and proposed solution:

Apparent Cause

The Game Center Sandbox tries to partition different version of an app from each other, so if you're changing the app's version number during Game Center sandbox testing, it's possible that ongoing matches could be orphaned, causing ghost badge counts.

Recommendations to Fix Ghost Matches

Disable Game Center for the app in iTunes connect. Give it a few hours (overnight would be perfect), then turn it on again. If your lucky, that'll be enough to reset things but if it doesn't work you'll need to have iTunes Connect reset it from their end. You can contact them directly using the "Contact Us" button on the bottom of this page: iTunes Connect Support.

Recommendations To Avoid This Problem

Change an app's build new rarely during Game Center match testing.

My Sandbox Results

I have disabled Game Center for my app, and will see in a few hours if my badge counts are reset. I left Game Center disabled for 14 hours, and still the badge counts did not reset. Consequently, I contacted iTunes Connect support and asked them to reset my app. They had to escalate the issue. Apple just called me back: their support is continuing to work on the problem, they recognize other developers are having similar problems.

I finally gave up trying to get help from Apple on this, because they kept going in circles between a couple of departments. Funny, just after I submitted my app for review, all of the old matches starting appearing in the sandbox game center. They were no longer ghost matches.

PS: I had also requested a reset of my sandbox leader boards the night before. Maybe the leader board reset released the ghost matches, or maybe the app submission. It was my first submission of the app, and I designated the version of the app as compatible with all versions for multiplayer.

My Production Results

The same problem is starting to slowly happen to a few of my users. A very small percentage of my users are experiencing icon badge counts that are a few matches too high.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top