Is there a way to update matchData in a GKTurnBasedMatch without sending out “Your Turn” push notifications?

前端 未结 3 776
情深已故
情深已故 2021-01-15 12:19

If my understanding is correct, the only way to update the matchData property of a GKTurnBasedMatch mid-turn is [_currentMatch endTurnWithNextParticipant:_currentParticipant

相关标签:
3条回答
  • 2021-01-15 12:54

    Mid-turn saving has been added in iOS 6 with:

    -[GKTurnBasedMatch saveCurrentTurnWithMatchData:completionHandler:]
    

    Source: GKTurnBasedMatch Class Reference

    0 讨论(0)
  • 2021-01-15 12:58

    Interestingly, to address your original question, it appears that saveCurrentTurnWithMatchData still sends out push notifications to the other players, even though the current player's turn hasn't ended!

    In my opinion, this seems like a GameKit design flaw- it seems inherently misleading to have a badge show up on an opponent's app icon when it isn't yet their turn. What a bummer to open it and see that it's just a false alarm over and over!

    If anyone has figured out a way to suppress these push notifications when calling saveCurrentTurnWithMatchData, I would love to hear how you did it.

    UPDATE: I started a new thread to address this issue.

    0 讨论(0)
  • 2021-01-15 13:08

    There shouldn't really be a reason to update the match data during the turn. None of the other players can react until their turn, so the data only needs to be passed as play transitions from one player to another.

    0 讨论(0)
提交回复
热议问题