---
title: "sendMessageToDataProvider(_:)"
framework: accessorytransportextension
role: symbol
role_heading: Instance Method
path: "accessorytransportextension/accessorytransportsession/sendmessagetodataprovider(_:)"
---

# sendMessageToDataProvider(_:)

Sends a message to the data provider extension.

## Declaration

```swift
func sendMessageToDataProvider(_ message: TransportMessage) throws(AccessoryTransportSession.Error)
```

## Parameters

- `message`: A transport message to send to the data provider.

## Discussion

Discussion Use this method to relay data from the accessory to your app’s AccessoryDataProvider extension. The system decrypts the message, if necessary, before delivering it to the data provider. Data providers receive the message through messageHandler(_:). note: This method relays data from the accessory for the Bluetooth transport type. For internet transport, the accessory routes its response to the device using pushToken; the system delivers the decrypted response to your data provider extension through the same message handler.
