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

# match(_:didReceive:fromRemotePlayer:)

Processes the data sent from another player to the local player.

## Declaration

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

## Parameters

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

## Mentioned in

Exchanging data between players in real-time games

## 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:forRecipient:fromRemotePlayer:)](gamekit/gkmatchdelegate/match(_:didreceive:forrecipient:fromremoteplayer:).md)
