---
title: "init(sourceIdentifier:notificationIdentifier:actionIdentifier:userText:)"
framework: accessorynotifications
role: symbol
role_heading: Initializer
path: "accessorynotifications/notificationresponse/init(sourceidentifier:notificationidentifier:actionidentifier:usertext:)"
---

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

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

## Declaration

```swift
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.
