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

If my understanding is correct, the only way to update the matchData property for GKTurnBasedMatch in the middle of the turn is [_currentMatch endTurnWithNextParticipant: _currentParticipant matchData: matchData completeHandler: nil].

This works well if the Game Center only has the game installed on one device, because the notification is delivered to the device as a message in the application. Thus, the notification can be hidden while the user is currently playing a turn. However, if the user has installed the game on several devices, other devices will receive a “Your Turn” push notification. This confuses the user, especially I update matchData several times.

By the way, I understand that I cannot use the endTurnWithNextParticipant: matchData: completeHandler: function because it was intended (because I am not actually ending the match ... but just updating matchData). However, there seems to be no alternative to updating the match state in the middle of the turn.

+2
source share
3 answers

IOS 6 adds an average value for saving RPM:

-[GKTurnBasedMatch saveCurrentTurnWithMatchData:completionHandler:] 

Source: GKTurnBasedMatch class reference

+2
source

Interestingly, to resolve your initial question, it seems that saveCurrentTurnWithMatchData strong> still sends push notifications to other players, even if the player’s current move has not yet ended!

In my opinion, this seems like a design flaw in GameKit - it seems misleading for the badge icon to appear on the adversary’s application icon when it’s not yet attacked. What a bummer to open it and see that it’s just a false alarm again and again!

If someone figured out a way to suppress these push notifications when calling saveCurrentTurnWithMatchData strong>, I would like to hear how you did it.

UPDATE . I started a new new thread to solve this problem.

+1
source

In fact, there should be no reason to update compliance data during the move. None of the other players can react before their turn, so the data should be transferred only in the form of transitions from one player to another.

-1
source

Source: https://habr.com/ru/post/1385821/


All Articles