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

# queryActivity(completionHandler:)

Finds the number of players, across player groups, who recently requested a match.

```
func queryActivity(completionHandler: (@Sendable (Int, (any Error)?) -> Void)? = nil)
```

## Parameters

`completionHandler`

The block that GameKit calls when it completes the request.

    This block receives the following parameters:

- `activity`: The number of match requests for all player groups during the previous 60 seconds.
- `error`: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

---

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)