---
title: AccessoryDataProvider
framework: accessorytransportextension
role: symbol
role_heading: Protocol
path: accessorytransportextension/accessorydataprovider
---

# AccessoryDataProvider

A protocol for an extension that receives iOS system notifications and curates their data for your accessory.

## Declaration

```swift
protocol AccessoryDataProvider : AppExtension, Sendable where Self.Configuration : AccessoryDataProviderConfiguration
```

## Mentioned in

Receiving iOS notifications on an accessory

## Overview

Overview Implement this protocol in an extension with an EXExtensionPointIdentifier value of com.apple.accessory-data-provider to receive notification data for eventual forwarding to an accessory that you develop. The extension runs in a sandboxed environment and communicates with the system through the extension’s configuration object (AccessoryDataProviderConfiguration). important: The system requires your app extension to have the com.apple.developer.accessory-data-provider entitlement to use this protocol. Add the necessary target configuration In your extension’s target properties, include the EXCapabilities key with the value AccessoryNotifications.NotificationsForwarding: <plist>     <dict>         <key>EXAppExtensionAttributes</key>         <dict>             <key>EXExtensionPointIdentifier</key>             <string>com.apple.accessory-data-provider</string>             <key>EXCapabilities</key>             <array>                 <string>AccessoryNotifications.NotificationsForwarding</string>             </array>         </dict>     </dict> </plist> Implement the extension point In your extension’s Swift code, implement the protocol and declare the capability with your NotificationsForwarding.AccessoryNotificationsHandler implementation: struct DataProvider: AccessoryDataProvider {     var extensionPoint: AppExtensionPoint {         Identifier("com.apple.accessory-data-provider")         Implementing {             NotificationsForwarding {                 MyNotificationsHandler()             }         }     } }

class MyNotificationsHandler: AccessoryNotificationsHandler {     // Your extension's implementation. } Share data between the app and the extension Configure a shared app group so your companion app can provide information to the extension. The extension has read-only access to the shared container. Use the shared container to store: Authentication tokens for your private servers Accessory-specific preferences (max payload size, content filtering) Device-specific configuration // In the companion app, write to the shared container. let sharedDefaults = UserDefaults(suiteName: "group.com.yourcompany.accessoryapp") sharedDefaults?.set(authToken, forKey: "ServerAuthToken")

// In the extension, read from the shared container. let sharedDefaults = UserDefaults(suiteName: "group.com.yourcompany.accessoryapp") let authToken = sharedDefaults?.string(forKey: "ServerAuthToken") For more information, see Receiving iOS notifications on an accessory.

## Relationships

### Inherits From

- [AppExtension](extensionfoundation/appextension.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Notification forwarding

- [Receiving iOS notifications on an accessory](accessorytransportextension/receiving-ios-notifications-on-an-accessory.md)
- [AccessoryDataProviderConfiguration](accessorytransportextension/accessorydataproviderconfiguration.md)
- [AccessoryTransportSecurity](accessorytransportextension/accessorytransportsecurity.md)
- [AccessoryTransportSecurityConfiguration](accessorytransportextension/accessorytransportsecurityconfiguration.md)
- [Accessory Notifications](accessorynotifications.md)
