---
title: "match(_:didReceive:forRecipient:fromRemotePlayer:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatchdelegate/match(_:didreceive:forrecipient:fromremoteplayer:)"
---

# match(_:didReceive:forRecipient:fromRemotePlayer:)

Processes the data sent from one player to another.

## Declaration

```swift
optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer)
```

## Parameters

- `match`: The match associated with the data.
- `data`: The data sent by the player.
- `recipient`: The player who receives the data.
- `player`: The player who sends the data.

## Discussion

Discussion Your game defines its own format for data packets it transmits and receives over the network. important: You need to treat data you receive from other players as untrusted data. Be sure to validate the data you receive from the match and write your code carefully to avoid security vulnerabilities.

## See Also

### Receiving Data from Other Players

- [match(_:didReceive:fromRemotePlayer:)](gamekit/gkmatchdelegate/match(_:didreceive:fromremoteplayer:).md)
