---
title: "reply(withLocalizableMessageKey:arguments:data:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkturnbasedexchange/reply(withlocalizablemessagekey:arguments:data:completionhandler:)"
---

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

Replies to an exchange request on behalf of a recipient.

## Declaration

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

```swift
func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws
```

## 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:

## Mentioned in

Exchanging data between players in turn-based games

## Discussion

Discussion To accept or decline an exchange request, invoke this method from the 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:) protocol method in the game instances of the sender and the current participant.

## See Also

### Replying to Exchange Requests

- [replies](gamekit/gkturnbasedexchange/replies.md)
- [status](gamekit/gkturnbasedexchange/status.md)
- [GKTurnBasedExchangeStatus](gamekit/gkturnbasedexchangestatus.md)
- [completionDate](gamekit/gkturnbasedexchange/completiondate.md)
