<!--
{
  "availability" : [
    "iOS: 26.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryNotifications",
  "identifier" : "/documentation/AccessoryNotifications/NotificationResponse/init(sourceIdentifier:notificationIdentifier:actionIdentifier:userText:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accessory Notifications"
    ],
    "preciseIdentifier" : "s:22AccessoryNotifications20NotificationResponseV16sourceIdentifier012notificationF006actionF08userTextACSS_S3SSgtcfc"
  },
  "title" : "init(sourceIdentifier:notificationIdentifier:actionIdentifier:userText:)"
}
-->

# init(sourceIdentifier:notificationIdentifier:actionIdentifier:userText:)

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

```
init(sourceIdentifier: String, notificationIdentifier: String, actionIdentifier: String, userText: String?)
```

## Parameters

`sourceIdentifier`

The bundle identifier of the app that sent the notification.

`notificationIdentifier`

The identifier for the notification.

`actionIdentifier`

The identifier for the action taken.

`userText`

Optional text provided by the person.

---

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)