Initiates a request to find players for a hosted match.
- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
The configuration for the desired match.
A block to be called when the match has been created. This block receives the following parameters:
If matchmaking was successful, this parameter contains an array of
GKPlayerobjects containing the players to connect into the match. Otherwise, this parameter is
If matchmaking was successful, this parameter contains
nil. Otherwise, this parameter holds an error object that describes the error that occurred.
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. When your completion handler is called, your game should connect those players to your own server.
On iOS 6, if the match request’s
players property is non-
NIL, Game Center sends invitations only out to the players listed in the property. If the
players property is
NIL, then it searches for any waiting players that match the request. Prior to iOS 6, the match request’s
players property is ignored and this method only searches for available players.