<!--
{
  "availability" : [
    "iOS: 26.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryTransportExtension",
  "identifier" : "/documentation/AccessoryTransportExtension/AccessoryTransportSession/sendMessageToDataProvider(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accessory Transport Extension"
    ],
    "preciseIdentifier" : "s:27AccessoryTransportExtension0aB7SessionC25sendMessageToDataProvideryyAA0bF0VAC5ErrorOYKF"
  },
  "title" : "sendMessageToDataProvider(_:)"
}
-->

# sendMessageToDataProvider(_:)

Sends a message to the data provider extension.

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

## Parameters

`message`

A transport message to send to the data provider.

## Discussion

Use this method to relay data from the accessory to your app’s [`AccessoryDataProvider`](/documentation/AccessoryTransportExtension/AccessoryDataProvider) extension. The system decrypts the message, if necessary, before delivering it to the data provider. Data providers receive the message through <doc://com.apple.documentation/documentation/AccessoryNotifications/NotificationsForwarding/AccessoryNotificationsHandler/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 ``doc://com.apple.accessorytransportextension/documentation/AccessoryTransportExtension/AccessoryTransportSession/pushToken``; the system delivers the decrypted response to your data provider extension through the same message handler.

---

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)