---
title: "findMatchedPlayers(_:withCompletionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatchmaker/findmatchedplayers(_:withcompletionhandler:)"
---

# findMatchedPlayers(_:withCompletionHandler:)

Initiates a request to find players for a hosted match that uses matchmaking rules.

## Declaration

```swift
func findMatchedPlayers(_ request: GKMatchRequest, withCompletionHandler completionHandler: @escaping @Sendable (GKMatchedPlayers?, (any Error)?) -> Void)
```

```swift
func findMatchedPlayers(_ request: GKMatchRequest) async throws -> GKMatchedPlayers
```

## Parameters

- `request`: The configuration for the match.
- `completionHandler`: The block that GameKit calls when it completes the request. This block receives the following parameters:

## Mentioned in

Finding players for custom server-based games

## Discussion

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.

## See Also

### Matching players

- [findMatch(for:withCompletionHandler:)](gamekit/gkmatchmaker/findmatch(for:withcompletionhandler:).md)
- [findPlayers(forHostedRequest:withCompletionHandler:)](gamekit/gkmatchmaker/findplayers(forhostedrequest:withcompletionhandler:).md)
- [GKMatchedPlayers](gamekit/gkmatchedplayers.md)
- [addPlayers(to:matchRequest:completionHandler:)](gamekit/gkmatchmaker/addplayers(to:matchrequest:completionhandler:).md)
- [finishMatchmaking(for:)](gamekit/gkmatchmaker/finishmatchmaking(for:).md)
- [cancel()](gamekit/gkmatchmaker/cancel().md)
- [cancelPendingInvite(to:)](gamekit/gkmatchmaker/cancelpendinginvite(to:).md)
