I'm trying to save match data with the Game Centre default function. The following function works pretty fine and things got saved.
self.myMatch?.saveCurrentTurn(withMatch: dataToSend, completionHandler: { (e) in
print(e ?? "No Error:")
})
This method was introduced in IOS 6, and at that time they were sending push notifications to the opponent as like the endTurnWithNextParticipant, but now in the current IOS 10, if they have removed feature of sending push notifications, but there should any other way to detect matchData update on opponents side.
Yes, the newer way is to use the player listener to detect this kind of change in the match. I have created an example project of a turn based GameKit game that you are welcome to use as a skeleton. The key function is found in the
ViewController.swiftfile:The references to the game
modelwill make much more sense in the context of the whole example project, but to your question: notice the "refreshing data for this match" line? That is how you detect new incoming match data. You can do with it whatever you need.