Search code examples
iosgame-centergamekit

Is there a way to programmatically decline a turn-based match in GameKit?


In a GKTurnBasedMatch, each GKTurnBasedParticipant has a status property. I would like to set this property to GKTurnBasedParticipantStatusDeclined; however, it is read-only. How can I programmatically do this?

To my knowledge, it can only be done from the GKTurnBasedMatchmakerViewController or by clearing an Invite notification.


Solution

  • To my knowledge you have to use -[GKTurnBasedMatch (void)participantQuitInTurnWithOutcome:(GKTurnBasedMatchOutcome)matchOutcome nextParticipant:(GKTurnBasedParticipant *)nextPlayer matchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler] to do so