---
title: "send(_:with:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkgamesession/send(_:with:completionhandler:)"
---

# send(_:with:completionHandler:)

Sends the indicated data to all connected players.

## Declaration

```swift
func send(_ data: Data, with transport: GKTransportType, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func send(_ data: Data, with transport: GKTransportType) async throws
```

## Parameters

- `data`: A Data object containing the information to be sent.
- `transport`: Determines how the data is sent.
- `completionHandler`: A block that is called after the data has been sent.

## See Also

### Connecting Players for Real-Time Communication

- [setConnectionState(_:completionHandler:)](gamekit/gkgamesession/setconnectionstate(_:completionhandler:).md)
- [players(with:)](gamekit/gkgamesession/players(with:).md)
- [GKTransportType](gamekit/gktransporttype.md)
