<!--
{
  "availability" : [
    "iOS: 26.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryNotifications",
  "identifier" : "/documentation/AccessoryNotifications/NotificationResponse",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accessory Notifications"
    ],
    "preciseIdentifier" : "s:22AccessoryNotifications20NotificationResponseV"
  },
  "title" : "NotificationResponse"
}
-->

# NotificationResponse

A structure that represents a person’s response to a notification.

```
struct NotificationResponse
```

## Overview

Create an instance of this structure when a person responds to a notification on your accessory. Send it to the system using [`sendResponse(_:)`](/documentation/AccessoryNotifications/NotificationsForwarding/AccessoryNotificationsSession/sendResponse(_:)) after receiving the response data through [`messageHandler(_:)`](/documentation/AccessoryNotifications/NotificationsForwarding/AccessoryNotificationsHandler/messageHandler(_:)).

## Topics

### Creating a notification response

[`init(sourceIdentifier: String, notificationIdentifier: String, actionIdentifier: String, userText: String?)`](/documentation/AccessoryNotifications/NotificationResponse/init(sourceIdentifier:notificationIdentifier:actionIdentifier:userText:))

Initializes a notification response with the given identifiers and optional user text.

### Identifying the response action

[`var actionIdentifier: String`](/documentation/AccessoryNotifications/NotificationResponse/actionIdentifier)

An identifier for the action the person took with the notification.

### Identifying the notification

[`var notificationIdentifier: String`](/documentation/AccessoryNotifications/NotificationResponse/notificationIdentifier)

An identifier for the notification.

[`var sourceIdentifier: String`](/documentation/AccessoryNotifications/NotificationResponse/sourceIdentifier)

A bundle identifier for the app that sent the notification.

### Accessing user-provided text

[`var userText: String?`](/documentation/AccessoryNotifications/NotificationResponse/userText)

A text string that a person provides in response to the notification.

## Relationships

### Conforms To

[`Encodable`](/documentation/Swift/Encodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Decodable`](/documentation/Swift/Decodable)

---

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)