Update the match data without advancing the game to another player.
- iOS 6.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
A serialized blob of data reflecting the game-specific state for the match. Do not pass
nilas an argument.
A block to be called after the data is uploaded to Game Center.
The block receives the following parameters:
If an error occurred, this error object describes the error. If the operation was completed successfully, the value is
This method updates the match data stored on Game Center. Call this method when the current player takes an action that advances the state of the match but does not end the player’s turn. For example, if your game has a fog-of-war mechanic, you might call this method when the player revealed new information on the map. Listing 1 shows a typical implementation of this method.
When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.