<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKTurnBasedExchange/reply(withLocalizableMessageKey:arguments:data:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKTurnBasedExchange(im)replyWithLocalizableMessageKey:arguments:data:completionHandler:"
  },
  "title" : "reply(withLocalizableMessageKey:arguments:data:completionHandler:)"
}
-->

# reply(withLocalizableMessageKey:arguments:data:completionHandler:)

Replies to an exchange request on behalf of a recipient.

```
func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

## Parameters

`key`

The identifier for looking up the translated reply message in the default `Localized.strings` file. If you use a formatted string with specifiers, provide the arguments.

`arguments`

A list of arguments to substitute into the localized string if it’s formatted and contains specifiers.

`data`

The game-specific data associated with the reply.

`completionHandler`

The block that GameKit calls when it completes the request.

    The block receives the following parameter:

- *error*: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

To accept or decline an exchange request, invoke this method from the [`player(_:receivedExchangeRequest:for:)`](/documentation/GameKit/GKTurnBasedEventListener/player(_:receivedExchangeRequest:for:)) protocol method. Include game-specific details about the exchange in the `data` parameter. When all recipients reply or time out, GameKit invokes the [`player(_:receivedExchangeReplies:forCompletedExchange:for:)`](/documentation/GameKit/GKTurnBasedEventListener/player(_:receivedExchangeReplies:forCompletedExchange:for:)) protocol method in the game instances of the sender and the current participant.

---

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)