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

# queryPlayerGroupActivity(_:withCompletionHandler:)

Finds the number of players in a player group who recently requested a match.

## Declaration

```swift
func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: (@Sendable (Int, (any Error)?) -> Void)? = nil)
```

```swift
func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int
```

## Parameters

- `playerGroup`: A number that uniquely identifies a subset of players in your game.
- `completionHandler`: The block that GameKit calls when it completes the request. This block receives the following parameters:

## Discussion

Discussion Use this method to update your interface. For example, show players the relative activity in each player group. If one group is less active than others, you might display a warning so players are aware that finding a match in that group may take longer.

## See Also

### Finding players who request matches

- [queryActivity(completionHandler:)](gamekit/gkmatchmaker/queryactivity(completionhandler:).md)
- [queryQueueActivity(_:withCompletionHandler:)](gamekit/gkmatchmaker/queryqueueactivity(_:withcompletionhandler:).md)
