iOS 6.0 has added a couple of new instance methods to the class GKTurnBasedMatch. I am not sure how to use them:
acceptInviteWithCompletionHandler
declineInviteWithCompletionHandler
Are they supposed to be used in response to receiving a turn-based match invite? Turn-based match invites are received through the GKTurnBasedEventHandlerDelegate protocol method: handleInviteFromGameCenter.
- (void) handleInviteFromGameCenter:(NSArray *)playersToInvite
handleInviteFromGameCenter does not provide a GKTurnBasedMatch instance to use for the purposes of accepting or declining. Consequently I do not know how to use them in response to an invite.
The only methods that provide GKTurnBasedMatch instances are:
+ loadMatchesWithCompletionHandler
+ findMatchForRequest:withCompletionHandler
I am not sure why I would use acceptInviteWithCompletionHandler on the results of loadMatchesWithCompletionHandler, because they are matches I am already participating in.
I am not sure why I would use either of them with findMatchForRequest:withCompletionHandler, because this is being called to find a match. Am I supposed to accept the match after finding it?
<- Update ->
I have found one use for declineInviteWithCompletionHandler. If a user requests to delete a match they have not taken a turn in, I call declineInviteWithCompletionHandler. This way they are not recorded as having quit the match.
When a player has not yet taken a turn, their GKTurnBasedParticipant.lastTurnDate is null
If a user requests to play a match (that I have displayed in a list using loadMatchesWithCompletionHandler) and if the local player has not taken a turn in the match, I am calling acceptInviteWithCompletionHandler, before I display the match to the player. I'm not sure if this is necessary, it just seemed like the right thing to do.