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

# match(_:didReceive:fromPlayer:)

Handles when a player receives data in a match.

## Declaration

```swift
optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String)
```

## Parameters

- `match`: The match that received the data.
- `data`: The bytes sent by the player.
- `playerID`: The string identifier for the player that sent the data.

## Discussion

Discussion You define your own format for data packets that you transmit and receive 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

### Deprecated Methods and Properties

- [match(_:player:didChange:)](gamekit/gkmatchdelegate/match(_:player:didchange:)-4eo7p.md)
- [match(_:shouldReinvitePlayer:)](gamekit/gkmatchdelegate/match(_:shouldreinviteplayer:).md)
