### AccessoryLiveActivity sourceBundleIdentifier property Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity/sourcebundleidentifier Defines the bundle identifier for the app that started the Live Activity. ```swift let sourceBundleIdentifier: String ``` -------------------------------- ### GET AccessoryLiveActivity.IconFile.url Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity/iconfile/url Retrieves the URL that locates the icon file's data for use in accessory transmissions. ```APIDOC ## GET AccessoryLiveActivity.IconFile.url ### Description A URL that locates the icon file’s data. Use this URL to retrieve the file’s data and include its contents in your transmission to the accessory. ### Method GET ### Endpoint AccessoryLiveActivity.IconFile.url ### Response #### Success Response (200) - **url** (URL) - A URL that locates the icon file’s data. ``` -------------------------------- ### GET liveActivities Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/liveactivities Retrieves the currently active Live Activities that the accessory is authorized to receive. ```APIDOC ## GET liveActivities ### Description Returns the currently active Live Activities that the accessory is authorized to receive. ### Method GET ### Endpoint liveActivities ### Response #### Success Response (200) - **liveActivities** ([AccessoryLiveActivity]) - A list of currently active Live Activities. ``` -------------------------------- ### activate(for:) Instance Method Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/activate%28for%3A%29 Establishes communication between the data provider extension and the system. This method is available on iOS and iPadOS version 26.5 and later (Beta). ```APIDOC ## activate(for:) ### Description Establishes communication between the data provider extension and the system. ### Method Instance Method ### Endpoint N/A (This is a method call within an extension) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```swift func activate(for session: LiveActivityForwarding.Session) ``` ### Response #### Success Response (200) N/A (This is a method call, not an API endpoint with a direct response) #### Response Example N/A ### Overview Store a reference to the session and use it to receive life-cycle events and updates to ongoing Live Activities. The session becomes invalid after the system calls `sessionInvalidated()` to indicate that the system won’t deliver Live Activities to your accessory. Don’t use the session after invalidation. ### See Also - `func sessionInvalidated()`: Indicates that the system invalidated the session and stopped sending Live Activity updates. ``` -------------------------------- ### Activate a Live Activity session Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/sessioninvalidated%28%29 Establishes communication between the data provider extension and the system. ```swift func activate(for: LiveActivityForwarding.Session) ``` -------------------------------- ### Initialize LiveActivityForwarding Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding Creates an object to manage Live Activity forwarding for your accessory. This initializer requires a handler for accessory live activities. ```swift init(() -> any LiveActivityForwarding.AccessoryLiveActivitiesHandler) ``` -------------------------------- ### presentAuthorizationSheet(forAccessory:) Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/presentauthorizationsheet%28foraccessory%3A%29 Presents the system UI that allows users to manage their permission to forward Live Activities to an accessory. This method is available for iOS and iPadOS 26.5+. ```APIDOC ## POST /websites/developer_apple_accessoryliveactivities/presentAuthorizationSheet ### Description Presents the system UI that allows people to manage their permission to forward Live Activities to an accessory. ### Method POST ### Endpoint /websites/developer_apple_accessoryliveactivities/presentAuthorizationSheet ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **accessory** (ASAccessory) - Required - The accessory that has the authorization settings you want to update. ### Request Example ```json { "accessory": "" } ``` ### Response #### Success Response (200) - **AccessoryAuthorizationResult** (AccessoryAuthorizationResult) - The updated authorization decision. #### Response Example ```json { "authorizationResult": "" } ``` ``` -------------------------------- ### Activate Accessory Live Activities Session Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/activate%28for%3A%29 Establishes communication between the data provider extension and the system. Store a reference to the session to receive life-cycle events and updates. ```swift func activate(for session: LiveActivityForwarding.Session) ``` -------------------------------- ### Initialize Live Activity Forwarding Manager Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 Creates an object to manage Live Activity forwarding for your accessory. The system calls the handler factory closure once for each Live Activity session. ```swift init(_ handlerFactory: @escaping @Sendable () -> any LiveActivityForwarding.AccessoryLiveActivitiesHandler) ``` -------------------------------- ### LiveActivityForwarding Class Source: https://developer.apple.com/documentation/accessoryliveactivities Manages permission requests for forwarding Live Activities to the accessory. ```APIDOC ## class LiveActivityForwarding ### Description A class for requesting permission to forward Live Activities to your accessory and handle them in your accessory’s data provider extension. ``` -------------------------------- ### LiveActivityForwarding Class Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding Provides methods for requesting permission to forward Live Activities to an accessory and handling them. ```APIDOC ## Class LiveActivityForwarding A class for requesting permission to forward Live Activities to your accessory and handle them in your accessory’s data provider extension. ### Topics #### Requesting Live Activity forwarding - `init(() -> any LiveActivityForwarding.AccessoryLiveActivitiesHandler)`: Creates an object you use to manage Live Activity forwarding for your accessory. - `static func authorization(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult`: Checks whether someone permits the system to forward Live Activities to the given accessory. - `static func presentAuthorizationSheet(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult`: Presents the system UI that allows people to manage their permission to forward Live Activities to an accessory. - `static let featureID: String`: A constant you use to configure your data provider extension’s capability to forward Live Activities to your accessory. #### Handling Live Activities - `protocol AccessoryLiveActivitiesHandler`: A protocol that defines methods for handling Live Activity life cycle events in your accessory’s data provider extension. - `class Session`: An object that represents the active connection between your data provider extension and the system. ``` -------------------------------- ### Initializer for Live Activity Forwarding Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 Creates an object used to manage Live Activity forwarding for your accessory. The system calls the handler factory closure once for each Live Activity session to create a new handler instance that receives updates. ```APIDOC ## init(_:) ### Description Creates an object you use to manage Live Activity forwarding for your accessory. ### Method Initializer ### Endpoint N/A (Initializer) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (N/A) None #### Response Example None ### Parameters - **handlerFactory** (@escaping @Sendable () -> any LiveActivityForwarding.AccessoryLiveActivitiesHandler) - Required - A closure that creates one new `LiveActivityForwarding.AccessoryLiveActivitiesHandler` instance for each new Live Activity session. ``` -------------------------------- ### Implement activityUpdated(_:) method Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/activityupdated%28_%3A%29 Use this method to receive and process Live Activity updates for display on an accessory. ```swift func activityUpdated(_ activity: AccessoryLiveActivity) ``` -------------------------------- ### Present Live Activities Authorization Sheet Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 Presents the system UI that allows users to manage their permission to forward Live Activities to an accessory. This function is available in beta. ```swift static func presentAuthorizationSheet(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult ``` -------------------------------- ### Implement AccessoryDataProvider with LiveActivityForwarding Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory Conform your AccessoryDataProvider struct to include LiveActivityForwarding, providing an instance of your LiveActivitiesHandler. ```swift @main struct DataProvider: AccessoryDataProvider { var extensionPoint: AppExtensionPoint { Identifier("com.apple.accessory-data-provider") Implementing { LiveActivityForwarding { LiveActivitiesHandler() } } } } ``` -------------------------------- ### Implement LiveActivitiesHandler Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory Implement the LiveActivityForwarding.AccessoryLiveActivitiesHandler protocol to manage Live Activity sessions and updates. Store the session and clean up when it's invalidated. ```swift /// Respond to Live Activity alert updates from the system. final class LiveActivitiesHandler: LiveActivityForwarding.AccessoryLiveActivitiesHandler { private var session: LiveActivityForwarding.Session? func activate(for session: LiveActivityForwarding.Session) { self.session = session // Load existing Live Activities as described in the next section. } func sessionInvalidated() { session = nil // Clean up display state on the accessory. } // Implement remaining protocol methods. } ``` -------------------------------- ### AccessoryLiveActivity Struct Source: https://developer.apple.com/documentation/accessoryliveactivities Represents the data structure of a forwarded Live Activity. ```APIDOC ## struct AccessoryLiveActivity ### Description The details of the Live Activity that iOS forwards to your accessory. ``` -------------------------------- ### Load Live Activities on Session Activation Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory When the Live Activity forwarding session is activated, fetch a snapshot of all currently active Live Activities using `session.liveActivities` to synchronize the accessory's display. ```swift func activate(for session: LiveActivityForwarding.Session) { self.session = session Task { do { let activities = try await session.liveActivities for activity in activities { // Send Live Activity information to your accessory. } } catch { // Handle the error appropriately. } } } ``` -------------------------------- ### Configure Accessory Data Provider for Live Activities Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory Add the 'AccessoryLiveActivities.LiveActivityForwarding' capability to your Accessory Data Provider extension's Info.plist to enable Live Activity forwarding. ```plist EXAppExtensionAttributes EXExtensionPointIdentifier com.apple.accessory-data-provider EXCapabilities AccessoryNotifications.NotificationsForwarding AccessoryLiveActivities.LiveActivityForwarding ``` -------------------------------- ### LiveActivityForwarding.Session API Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session Details about the LiveActivityForwarding.Session class, including its properties and methods for interacting with Live Activities on accessories. ```APIDOC ## Class: LiveActivityForwarding.Session An object that represents the active connection between your data provider extension and the system. **Availability:** iOS 26.5+ Beta, iPadOS 26.5+ Beta ```swift final class Session ``` ### Overview Each `Session` has one corresponding `LiveActivityForwarding.AccessoryLiveActivitiesHandler`. ### Topics #### Working with Live Activities - `var liveActivities: [AccessoryLiveActivity]` The currently active Live Activities that the accessory is authorized to receive. - `func send(message: AccessoryMessage) async throws` Sends a message to the paired accessory. ### Relationships #### Conforms To - `Sendable` - `SendableMetatype` ### See Also #### Live Activity forwarding - `protocol AccessoryLiveActivitiesHandler` A protocol that defines methods for handling Live Activity life cycle events in your accessory’s data provider extension. **Note:** This documentation contains preliminary information about an API or technology in development. This information is subject to change. ``` -------------------------------- ### Load source app icon for Live Activity Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory Retrieves the app icon data using the ephemeral URL provided by the AccessoryLiveActivity.IconFile object. ```swift func loadIcon(from iconFile: AccessoryLiveActivity.IconFile) async throws -> Data { let url = try await iconFile.url return try Data(contentsOf: url) } ``` -------------------------------- ### Check Accessory Authorization for Live Activities Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 Checks whether the user permits the system to forward Live Activities to the given accessory. This function is available in beta. ```swift static func authorization(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult ``` -------------------------------- ### Present Authorization Sheet for Accessory Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/presentauthorizationsheet%28foraccessory%3A%29 Call this method to allow users to update their Live Activity forwarding preferences for a specific accessory. ```swift static func presentAuthorizationSheet(forAccessory accessory: ASAccessory) async throws -> AccessoryAuthorizationResult ``` -------------------------------- ### Access app icon Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity Properties to access the icon of the app that initiated the Live Activity. ```swift let sourceBundleIcon: AccessoryLiveActivity.IconFile? ``` ```swift struct IconFile ``` -------------------------------- ### Accessory Live Activities - activityUpdated(_:) Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/activityupdated%28_%3A%29 This method is a callback used to keep an accessory's display synchronized with the current state of a Live Activity. It involves parsing the activity's details, selecting relevant information for the accessory, converting it to transmittable data, and sending it via the Live Activity's `LiveActivityForwarding.Session`. If the activity state is `ActivityState.dismissed`, the Live Activity should be removed from the accessory's display. ```APIDOC ## Instance Method # activityUpdated(_:) Provides an updated Live Activity. ## Parameters - **activity** (AccessoryLiveActivity) - Required - The updated Live Activity. ## Overview Use this callback method to keep the accessory’s display in sync with the current state of the Live Activity. Parse the activity’s details, select the information to display on your accessory, and convert it to data for transmission. Then, send the data to your accessory using the Live Activity’s corresponding `LiveActivityForwarding.Session` and its `send(message:)` method. If the activity’s `state` property equals `ActivityState.dismissed`, remove the Live Activity from the accessory’s display. ## See Also ### Receiving Live Activity updates `func activityUpdatedForAlert(AccessoryLiveActivity) -> Bool` Provides an updated Live Activity and requests confirmation that the accessory displayed an alert. ``` -------------------------------- ### AccessoryAuthorizationResult.limited Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/limited An option that indicates the person allows Live Activities from a selected subset of apps. ```APIDOC ## AccessoryAuthorizationResult.limited ### Description An option that indicates the person allows Live Activities from a selected subset of apps. ### Availability - iOS 26.5+ Beta - iPadOS 26.5+ Beta ### Definition ```swift case limited ``` ``` -------------------------------- ### Access activity state and content Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity Properties to retrieve the current lifecycle state and the content of the forwarded activity. ```swift let state: ActivityState ``` ```swift let content: AccessoryLiveActivity.Content? ``` ```swift struct Content ``` -------------------------------- ### AccessoryLiveActivitiesHandler Protocol Definition Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler The base protocol definition for handling Live Activity life cycle events, requiring conformance to Sendable. ```swift protocol AccessoryLiveActivitiesHandler : Sendable ``` -------------------------------- ### AccessoryLiveActivity activityIdentifier property Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity/sourcebundleidentifier Provides a unique string identifier for the Live Activity. ```swift let activityIdentifier: String ``` -------------------------------- ### POST send(message:) Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/liveactivities Sends a message to the paired accessory. ```APIDOC ## POST send(message:) ### Description Sends a message to the paired accessory. ### Method POST ### Endpoint send(message:) ### Parameters #### Request Body - **message** (AccessoryMessage) - Required - The message to be sent to the paired accessory. ``` -------------------------------- ### AccessoryLiveActivitiesHandler Protocol Source: https://developer.apple.com/documentation/accessoryliveactivities Defines the interface for handling Live Activity lifecycle events within the accessory's data provider extension. ```APIDOC ## protocol AccessoryLiveActivitiesHandler ### Description A protocol that defines methods for handling Live Activity life cycle events in your accessory’s data provider extension. ### Usage Implement this protocol in your data provider extension to receive updates and alerts forwarded from the iPhone. ``` -------------------------------- ### Identify the activity Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity Properties used to uniquely identify the Live Activity and its originating app. ```swift let activityIdentifier: String ``` ```swift let sourceBundleIdentifier: String ``` -------------------------------- ### Check Live Activity Forwarding Authorization Source: https://developer.apple.com/documentation/accessoryliveactivities/receiving-live-activities-on-an-accessory Check the current authorization state for Live Activity forwarding for a given accessory. This method should be called before performing any logic that relies on Live Activity forwarding. If authorization is denied, this code presents a sheet to allow the user to update their choice. ```swift func checkAuthorization(for accessory: ASAccessory) async throws { let result = try await LiveActivityForwarding.authorization( forAccessory: accessory ) switch result { case .allow, .limited: // Add code specific to your app that's related to Live Activity forwarding. // For example, you might set a flag that helps the // companion app display UI that indicates Live Activity forwarding. case .deny: // Present the system UI that lets the person update their Live Activity forwarding authorization. let updatedAuthorization = try await LiveActivityForwarding .presentAuthorizationSheet(forAccessory: accessory) if updatedAuthorization == .allow || updatedAuthorization == .limited { // Add code specific to your app that's related to Live Activity forwarding. // For example, you might set a flag that helps the // companion app display UI that indicates Live Activity forwarding. } case .undetermined: // Prompt for permission to opt into notification and activity forwarding. let center = AccessoryNotificationCenter() try await center.requestForwarding(for: accessory) } } ``` -------------------------------- ### AccessoryLiveActivitiesHandler Protocol Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler Implement this protocol to receive forwarded Live Activity content and life cycle updates in your AccessoryDataProvider extension. Each AccessoryLiveActivitiesHandler object has one corresponding LiveActivityForwarding.Session. ```APIDOC ## Protocol AccessoryLiveActivitiesHandler ### Description A protocol that defines methods for handling Live Activity life cycle events in your accessory’s data provider extension. ### Topics #### Managing the session life cycle - `func activate(for: LiveActivityForwarding.Session)` Establishes communication between the data provider extension and the system. **Required** - `func sessionInvalidated()` Indicates that the system invalidated the session and stopped sending Live Activity updates. **Required** #### Receiving Live Activity updates - `func activityUpdated(AccessoryLiveActivity)` Provides an updated Live Activity. **Required** - `func activityUpdatedForAlert(AccessoryLiveActivity) -> Bool` Provides an updated Live Activity and requests confirmation that the accessory displayed an alert. **Required** #### Receiving data from your accessory - `func messageReceived(TransportMessage)` Delivers a message from the paired accessory to your data provider extension. **Required** ### Inherits From - `Sendable` - `SendableMetatype` ``` -------------------------------- ### AccessoryLiveActivity Properties Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity/sourcebundleidentifier Details regarding the sourceBundleIdentifier property for AccessoryLiveActivity. ```APIDOC ## AccessoryLiveActivity.sourceBundleIdentifier ### Description The bundle identifier of the app that started the Live Activity. ### Property - **sourceBundleIdentifier** (String) - The bundle identifier of the app that started the Live Activity. ### Availability - iOS 26.5+ Beta - iPadOS 26.5+ Beta ### See Also - **activityIdentifier** (String) - A string that uniquely identifies the Live Activity. ``` -------------------------------- ### messageReceived(_:) Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/messagereceived%28_%3A%29 Delivers a message from the paired accessory to your data provider extension. ```APIDOC ## messageReceived(_:) ### Description Delivers a message from the paired accessory to your data provider extension. ### Method Instance Method ### Parameters #### message - **message** (TransportMessage) - Required - The message received from the accessory. ### Request Example func messageReceived(_ message: TransportMessage) ``` -------------------------------- ### send(message:) Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/send%28message%3A%29 Sends a message to the paired accessory device. ```APIDOC ## send(message:) ### Description Sends a message to the paired accessory. Use this method to send data to the paired accessory. To receive responses from the accessory, implement the messageReceived(_:) method in your LiveActivityForwarding.AccessoryLiveActivitiesHandler. ### Method Instance Method ### Parameters #### Path Parameters - **message** (AccessoryMessage) - Required - The message to send to the accessory device. ### Request Example final func send(message: AccessoryMessage) async throws ``` -------------------------------- ### Accessing active Live Activities Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/liveactivities Retrieves the list of currently active Live Activities that the accessory is authorized to receive. ```swift final var liveActivities: [AccessoryLiveActivity] { get async throws } ``` -------------------------------- ### AccessoryAuthorizationResult Enum Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/allow Defines the possible authorization states for Live Activity forwarding. ```APIDOC ## AccessoryAuthorizationResult ### Description An enumeration representing the authorization status for Live Activity forwarding to accessories. ### Cases - **allow**: Indicates the person allows Live Activity forwarding from all apps that support them. - **undetermined**: Indicates the system hasn’t shown the authorization prompt to the person. - **limited**: Indicates the person allows Live Activities from a selected subset of apps. - **deny**: Indicates the person doesn’t allow Live Activities. ``` -------------------------------- ### Define AccessoryLiveActivity structure Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity The primary structure representing a Live Activity forwarded to an accessory. ```swift struct AccessoryLiveActivity ``` -------------------------------- ### Declare LiveActivityForwarding Class Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding Declare the LiveActivityForwarding class, which is central to managing Live Activities on an accessory. Available on iOS and iPadOS 26.5+ Beta. ```swift final class LiveActivityForwarding ``` -------------------------------- ### Live Activity Forwarding Feature ID Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 A constant used to configure your data provider extension's capability to forward Live Activities to your accessory. This is a beta feature. ```swift static let featureID: String ``` -------------------------------- ### Related Functionalities Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/init%28_%3A%29 APIs related to managing Live Activity forwarding, including checking authorization, presenting authorization sheets, and accessing the feature ID. ```APIDOC ## Related APIs ### `authorization(forAccessory:)` #### Description Checks whether the user permits the system to forward Live Activities to the given accessory. #### Method `static func authorization(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult` #### Endpoint N/A (Static Method) ### `presentAuthorizationSheet(forAccessory:)` #### Description Presents the system UI that allows users to manage their permission to forward Live Activities to an accessory. #### Method `static func presentAuthorizationSheet(forAccessory: ASAccessory) async throws -> AccessoryAuthorizationResult` #### Endpoint N/A (Static Method) ### `featureID` #### Description A constant used to configure your data provider extension's capability to forward Live Activities to your accessory. #### Method `static let featureID: String` #### Endpoint N/A (Static Property) ``` -------------------------------- ### Declare LiveActivityForwarding.Session Class Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session This Swift code declares the final class Session, which is part of the LiveActivityForwarding framework. It represents the active connection for Live Activities on accessories. ```swift final class Session ``` -------------------------------- ### AccessoryAuthorizationResult.deny Case Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/allow Use this case to indicate that the user has chosen not to allow Live Activities. This is a beta option. ```swift case deny ``` -------------------------------- ### Implement messageReceived(_:) in AccessoryLiveActivitiesHandler Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/messagereceived%28_%3A%29 Use this method to process messages received from a paired accessory. It is required for handling data forwarded to the extension. ```swift func messageReceived(_ message: TransportMessage) ``` -------------------------------- ### AccessoryAuthorizationResult.deny Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/deny An option that indicates the person doesn’t allow Live Activities. Available on iOS 26.5+ Beta and iPadOS 26.5+ Beta. ```APIDOC ## AccessoryAuthorizationResult.deny ### Description An option that indicates the person doesn’t allow Live Activities. ### Platform Availability iOS 26.5+ Beta iPadOS 26.5+ Beta ### See Also * `case undetermined`: An option that indicates the system hasn’t shown the authorization prompt to the person. * `case allow`: An option that indicates the person allows Live Activity forwarding from all apps that support them. * `case limited`: An option that indicates the person allows Live Activities from a selected subset of apps. ``` -------------------------------- ### AccessoryLiveActivity Structure Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity The AccessoryLiveActivity structure represents the Live Activity details that iOS forwards to your accessory. It includes properties for identifying the activity, accessing its state and content, and retrieving the source app's icon. ```APIDOC ## AccessoryLiveActivity The details of the Live Activity that iOS forwards to your accessory. ### Properties - **activityIdentifier** (String) - A string that uniquely identifies the Live Activity. - **sourceBundleIdentifier** (String) - The bundle identifier of the app that started the Live Activity. - **state** (ActivityState) - The current state of the activity in its life cycle. - **content** (AccessoryLiveActivity.Content?) - The updated content of the forwarded Live Activity. - **Content Struct**: The content of an alert for a forwarded Live Activity. - **sourceBundleIcon** (AccessoryLiveActivity.IconFile?) - The icon of the app that initiated the Live Activity. - **IconFile Struct**: An on-demand reference to the app icon of the app that started the Live Activity. ### Conforms To - Sendable - SendableMetatype ``` -------------------------------- ### AccessoryAuthorizationResult.allow Case Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/allow Use this case to indicate that the user has granted permission for Live Activity forwarding from all apps that support them. Available for iOS and iPadOS 26.5+ Beta. ```swift case allow ``` -------------------------------- ### AccessoryAuthorizationResult Enumeration Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult The AccessoryAuthorizationResult enumeration defines the possible outcomes when checking or requesting permission for Live Activity forwarding to an accessory. ```APIDOC ## Enumeration AccessoryAuthorizationResult Responses to the Live Activity forwarding permission prompt. ### Topics `case undetermined` An option that indicates the system hasn’t shown the authorization prompt to the person. `case allow` An option that indicates the person allows Live Activity forwarding from all apps that support them. `case limited` An option that indicates the person allows Live Activities from a selected subset of apps. `case deny` An option that indicates the person doesn’t allow Live Activities. ### Overview Call `authorization(forAccessory:)` to check the current forwarding authorization for an accessory without showing any UI. If the result is `.undetermined`, ask people for their permission to forward iOS system notifications and Live Activities to your accessory. For more information, see Receiving Live Activity updates and alerts on an accessory. To ask if someone wants to update their current selection – for example, if they previously denied Live Activity forwarding – call `presentAuthorizationSheet(forAccessory:)`. ### See Also #### Authorization `class LiveActivityForwarding` A class for requesting permission to forward Live Activities to your accessory and handle them in your accessory’s data provider extension. ``` -------------------------------- ### Sending messages to an accessory Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/liveactivities Sends a message to a paired accessory as part of the Live Activity communication flow. ```swift func send(message: AccessoryMessage) async throws ``` -------------------------------- ### Retrieve icon file URL Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryliveactivity/iconfile/url Access the URL for the icon file data asynchronously. This property is available in iOS 26.5+ and iPadOS 26.5+. ```swift var url: URL { get async throws } ``` -------------------------------- ### AccessoryAuthorizationResult.undetermined Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/undetermined Represents the state where the system has not yet presented the authorization prompt to the user for Live Activity forwarding to an accessory. ```APIDOC ## AccessoryAuthorizationResult.undetermined ### Description An option that indicates the system hasn’t shown the authorization prompt to the person. ### Method N/A (Enum Case) ### Endpoint N/A (Enum Case) ### Parameters N/A ### Request Example N/A ### Response #### Success Response (N/A) N/A #### Response Example N/A ### Discussion An `.undetermined` authorization result indicates that the person hasn’t seen the authorization prompt that asks for permission to forward iOS system notifications and Live Activities to your accessory. If they see the authorization prompt and dismiss it, the `AccessoryAuthorizationResult` changes to `AccessoryAuthorizationResult.deny`. ### See Also - `case allow`: Indicates the person allows Live Activity forwarding from all apps that support them. - `case limited`: Indicates the person allows Live Activities from a selected subset of apps. - `case deny`: Indicates the person doesn’t allow Live Activities. ``` -------------------------------- ### Define AccessoryAuthorizationResult.undetermined Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/undetermined Represents the initial state where the system has not yet requested authorization from the user. ```swift case undetermined ``` -------------------------------- ### AccessoryAuthorizationResult.limited case definition Source: https://developer.apple.com/documentation/accessoryliveactivities/accessoryauthorizationresult/limited Represents the authorization state where the user has restricted Live Activity access to a subset of apps. ```swift case limited ``` -------------------------------- ### Send a message to an accessory Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/session/send%28message%3A%29 Sends a specified message to the paired accessory device. This method is asynchronous and may throw an error during transmission. ```swift final func send(message: AccessoryMessage) async throws ``` -------------------------------- ### Instance Method: sessionInvalidated() Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/sessioninvalidated%28%29 Indicates that the system invalidated the session and stopped sending Live Activity updates. This method is called when the system decides to stop sending updates for a Live Activity session. ```APIDOC ## Instance Method: sessionInvalidated() ### Description Indicates that the system invalidated the session and stopped sending Live Activity updates. ### Method Instance Method ### Endpoint N/A (Instance Method) ### Parameters None ### Request Example N/A ### Response N/A ### See Also - `func activate(for: LiveActivityForwarding.Session)`: Establishes communication between the data provider extension and the system. ``` -------------------------------- ### Define sessionInvalidated() Source: https://developer.apple.com/documentation/accessoryliveactivities/liveactivityforwarding/accessoryliveactivitieshandler/sessioninvalidated%28%29 This method is called when the system invalidates the session and ceases the transmission of Live Activity updates. ```swift func sessionInvalidated() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.