<!--
{
  "availability" : [
    "iOS: 4.1.0 - 8.0.0",
    "iPadOS: 4.1.0 - 8.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.8.0 - 10.10.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchmaker/findPlayers(forHostedMatchRequest:withCompletionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatchmaker(im)findPlayersForHostedMatchRequest:withCompletionHandler:"
  },
  "title" : "findPlayers(forHostedMatchRequest:withCompletionHandler:)"
}
-->

# findPlayers(forHostedMatchRequest:withCompletionHandler:)

Initiates a request to find players for a hosted match.

```
func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (@Sendable ([String]?, (any Error)?) -> Void)? = nil)
```

## Parameters

`request`

The configuration for the desired match.

`completionHandler`

A block to call when GameKit creates the match. This block receives the following parameters:

- *playerIDs*: If matchmaking was successful, this parameter contains an array of `NSString` objects containing the players to connect into the match. Otherwise, this parameter is `nil`.
- *error*: If matchmaking was successful, this parameter contains `nil`. Otherwise, this parameter holds an error object that describes the error that occurred.

## Discussion

When GameKit calls this completion handler, your game needs to connect those players to your own server.

On iOS 6, if the match request’s [`playersToInvite`](/documentation/GameKit/GKMatchRequest/playersToInvite) property is non-`NIL`, Game Center only sends invitations out to the players listed in the property. If the [`playersToInvite`](/documentation/GameKit/GKMatchRequest/playersToInvite) property is `NIL`, Game Center then searches for any waiting players that match the request. Prior to iOS 6, GameKit ignores the match request’s [`playersToInvite`](/documentation/GameKit/GKMatchRequest/playersToInvite) property and this method only searches for available players.

## See Also

[`-  cancel`](/documentation/GameKit/GKMatchmaker/cancel())

Cancels a matchmaking request.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)