0 Replies
      Latest reply on Dec 24, 2018 9:03 PM by dvartzlimited
      dvartzlimited Level 2 Level 2 (15 points)

        In my GKTurnBasedMatch, if a player quits the turn is then passed onto the second player. As this is only a two player game, I automatically make them win upon receiving the notification.

        But for some reason, the App Icon badge is still showing 1 notification? I'm not sure why this hasn't dismissed?

        Here's what I run when the notification of the other player quit comes through:

         

        func CheckForWin (matchToCheck: GKTurnBasedMatch) {
                
                for opponent in matchToCheck.participants {
                    if opponent.matchOutcome == .quit {
                        
                        matchToCheck.currentParticipant?.matchOutcome = .won
                        matchToCheck.endMatchInTurn(withMatch: Data()) { (error) in
                            
                            // All Done, load the matches again...
                        }
                    }
                }
                
            }