---
title: "findPlayersForHostedMatch(completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkgameactivity/findplayersforhostedmatch(completionhandler:)"
---

# findPlayersForHostedMatch(completionHandler:)

Use information from the activity to find server hosted players for the local player.

## Declaration

```swift
func findPlayersForHostedMatch(completionHandler: @escaping @Sendable ([GKPlayer]?, (any Error)?) -> Void)
```

```swift
func findPlayersForHostedMatch() async throws -> [GKPlayer]
```

## Mentioned in

Creating activities for your game

## Discussion

Discussion GameKit creates a classic server hosted match making request with the activity’s party code and other information, and returns the players in the completion handler or any error that occurred. An error occurs if this activity doesn’t support party code, or has unsupported range of players, which is used to be configured as match request’s minPlayers and maxPlayers.

## See Also

### Performing a matchmaking request

- [findMatch(completionHandler:)](gamekit/gkgameactivity/findmatch(completionhandler:).md)
