A few weeks ago I created a TurnBased 2-player game running on iOS 5.
The game allows the player to choose an opponent from their friends from its own interface, and then uses the playersToInvite property of GKMatchRequest when presenting the match making view, in order to make it automatically invite them.
Contrary to the documentation which says it "does nothing" prior to iOS6, this has the effect of causing the GKTurnBasedMatchmakerViewController to automatically select the chosen player and start an invite when running on iOS5.
On return of the request, in:
- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController didFindMatch:(GKTurnBasedMatch *)match
this app then immediately carries out a turn and passes it to the next player. This causes the actual invite to occur for the other player along with their turn, and the game proceeds nicely from there.
The match.participants in the delegate call above both contain valid playerID properties, making the "nextParticipant" call possible and valid.
So far, all so good, on iOS 5.
However, when running on iOS 6, everything proceeds as usual until we get to
- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController didFindMatch:(GKTurnBasedMatch *)match
and we discover that the second participant has a nil playerID, and attempting to set it as the next participant fails with "Unknown operation".
Investigating further, if I start the match request as usual, but then cancel the invitation in the GC UI, and then invite again via the GC UI, it all works as expected. It is ONLY when setting the playersToInvite myself that the invite fails. I have confirmed the playerIDs are correct in all cases, except for the spurious nil on iOS6.
Note that this all behaves correctly when running on iOS5.
It appears to me that Apple made it work in iOS5 and claimed that it didn't, and then broke it in iOS6 and claimed that it works :)
Just in case this is useful to somebody:
I solved this by adding specific implementation for iOS6. So when inviting a player, instead of launching the MatchMakerVC as in iOS5, do it programmatically.
[GKTurnBasedMatch findMatchForRequest: request withCompletionHandler:^(GKTurnBasedMatch *match, NSError *error)
This actually then works better than it does in iOS5 because you an avoid forcing the user to tap "Next" 3 times.
I still consider the original problem to be a bug, and it cost me 50 reputation on a wasted bounty here, but there we go we live and learn and forget and learn again :)