---
title: "sendData(_:toApplication:session:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceextension/senddata(_:toapplication:session:)"
---

# sendData(_:toApplication:session:)

Called when an app sends data to a remote application.

## Declaration

```swift
@MainActor func sendData(_ data: Data, toApplication applicationIdentifier: String, session: MediaOutputSession)
```

## Parameters

- `data`: The data to send to the remote application.
- `applicationIdentifier`: The identifier of the target application.
- `session`: The session associated with the data transfer.

## Discussion

Discussion In the case of media-app to remote media-application communication, the media-application’s specific application identifier will be used. In the case of media-app to media device extension communication, the following application identifier will be used: com.apple.media-device-extension.
