A peer-to-peer network between a group of devices that are connected to Game Center.


@interface GKMatch : NSObject


Matches provide transmittal of both voice and game data. Your game never directly allocates GKMatch objects. Instead, it uses the GKMatchmaker class to programmatically find a match with other interested players or a GKMatchmakerViewController object to display a user interface to the player.

After your game receives a match object, set its delegate and then wait until the other participants are connected to the match. You can read the expectedPlayerCount property to determine how many players have not connected to the match.

Each device in the match is identified by the player identifier for the player authenticated on that device. Your game transmits its own data to other players by calling either the sendDataToAllPlayers:withDataMode:error: method or the sendData:toPlayers:withDataMode:error: method. To allow voice chat, call voiceChatWithName: to create one or more voice channels.

When you are finished with the match, call the match’s disconnect method. Before you release your last reference to a GKMatch object, make sure you set the delegate back to nil. Otherwise a match you thought was long gone can suddenly call match:player:didChangeState: when you are in the middle of the next game.


Getting and Setting the Delegate


The delegate for the match.


The delegate is called when status updates and network data is received from players.

Working with Other Players


The remaining number of players who have not yet connected to the match.


An array of GKPlayer objects that represent the players in the match.

Sending Data to Other Players

- chooseBestHostingPlayerWithCompletionHandler:

Determines the best player in the game to act as the server for a client-server match.

- sendData:toPlayers:dataMode:error:

Transmits data to a list of connected players.

- sendDataToAllPlayers:withDataMode:error:

Transmits data to all players connected to the match.


The mechanism used to transmit data to other players.

Joining a Voice Chat

- voiceChatWithName:

Joins a voice channel.

Finishing the Match

- disconnect

Disconnects the local player from the match.

- rematchWithCompletionHandler:

Create a new match with the list of players from an existing match.

Deprecated Methods and Properties

- chooseBestHostPlayerWithCompletionHandler:

Determines the best player in the game to act as the server for a client-server match.


An array of NSString objects containing the player identifiers for remote players in the match.

- sendData:toPlayers:withDataMode:error:

Transmits data to a list of connected players.



Inherits From

See Also

Real-Time Matches


A set of parameters for a new live or turn-based match.


A voice channel that allows a set of players in a match to speak with each other.