So my match has two players. When the player 1, creates a new match, I use endTurnWithNextParticipants
method and supply the nextParticipants with GKTurnBasedMatch's participants array property which has two participants.
But on the player 1 device, it keeps saying that it is your turn. And player 2's device, it says "their turn".
- (void)endTurnWithNextParticipants:(NSArray<GKTurnBasedParticipant *> *)nextParticipants
turnTimeout:(NSTimeInterval)timeout
matchData:(NSData *)matchData
completionHandler:(void (^)(NSError *error))completionHandler
Any suggestions?
Edit:
Here is how I used endTurnWithNextParticipants
. currentTurnBasedMatch
is an instance of GKTurnBasedMatch. I did verify that instance does contain two participants (player 1 and 2) correctly. And the completion does not have any error.
[self.currentTurnBasedMatch endTurnWithNextParticipants:self.currentTurnBasedMatch.participants turnTimeout:GKTurnTimeoutDefault matchData:data completionHandler:^(NSError * _Nullable error) {
MyNSLogSys2O(@"completion error:", error); //default 1 week timeout
}];