findMatchedPlayers(_:withCompletionHandler:)
Initiates a request to find players for a hosted match that uses matchmaking rules.
Declaration
func findMatchedPlayers(_ request: GKMatchRequest, withCompletionHandler completionHandler: @escaping @Sendable (GKMatchedPlayers?, (any Error)?) -> Void)func findMatchedPlayers(_ request: GKMatchRequest) async throws -> GKMatchedPlayersParameters
- request:
The configuration for the match.
- completionHandler:
The block that GameKit calls when it completes the request.
This block receives the following parameters:
matchedPlayersThe players that join the match, including their properties that matchmaking rules uses. If unsuccessful, this parameter is
nil.errorDescribes an error if it occurs, or
nilif the operation completes.
Mentioned in
Discussion
To find players using matchmaking rules, set the rules-related properties in request (queueName and optionally, properties) before you call this method. For more information, see Matchmaking rules.