---
title: "addNotification(_:alertingContext:)"
framework: accessorynotifications
role: symbol
role_heading: Instance Method
path: "accessorynotifications/notificationsforwarding/accessorynotificationshandler/addnotification(_:alertingcontext:)"
---

# addNotification(_:alertingContext:)

Provides a new notification for display on your accessory.

## Declaration

```swift
func addNotification(_ notification: AccessoryNotification, alertingContext: AlertingContext) async throws -> Bool
```

## Parameters

- `notification`: The notification to add.
- `alertingContext`: Context for evaluating whether the notification can alert or be delivered quietly.

## Return Value

Return Value true if the accessory alerted for the notification, false otherwise. If this method throws an error, the system assumes the accessory did not alert.

## Discussion

Discussion Parse the notification details, select the information to display on your accessory, and convert it to data for transmission. Return true if your accessory successfully alerts for the notification.
