<!--
{
  "availability" : [
    "iOS: 4.1.0 -",
    "iPadOS: 4.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatch/sendData(toAllPlayers:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatch(im)sendDataToAllPlayers:withDataMode:error:"
  },
  "title" : "sendData(toAllPlayers:with:)"
}
-->

# sendData(toAllPlayers:with:)

Transmits data to all players connected to the match.

```
func sendData(toAllPlayers data: Data, with mode: GKMatch.SendDataMode) throws
```

## Parameters

`data`

The bytes to send.

`mode`

The mechanism used to send the data.

## Discussion

The match queues the data and transmits it when the network becomes available.

---

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)