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

# AlertingContext

A structure that provides guidance for how to alert for a notification.

```
struct AlertingContext
```

## Overview

To alert for a notification, present it on screen, play a sound, or trigger a haptic effect that uses touch to give users feedback.

## Topics

### Creating an alerting context

[`init(notificationCanAlert: Bool, suppressedByFocus: Bool, kind: AlertingContext.Kind, sound: AlertingContext.Sound?)`](/documentation/AccessoryNotifications/AlertingContext/init(notificationCanAlert:suppressedByFocus:kind:sound:))

Initializes an alerting context with notification alert conditions.

### Determining alerting behavior

[`var shouldAlert: Bool`](/documentation/AccessoryNotifications/AlertingContext/shouldAlert)

A Boolean value that indicates the recommended alerting behavior.

[`var notificationCanAlert: Bool`](/documentation/AccessoryNotifications/AlertingContext/notificationCanAlert)

A Boolean value that indicates whether the accessory can alert the person for the notification.

[`var isSuppressedByFocus: Bool`](/documentation/AccessoryNotifications/AlertingContext/isSuppressedByFocus)

A Boolean value that indicates whether the device’s Focus state suppresses notification alerts.

### Classifying the notification type

[`var kind: AlertingContext.Kind`](/documentation/AccessoryNotifications/AlertingContext/kind-swift.property)

A classification for the notification type.

[`enum Kind`](/documentation/AccessoryNotifications/AlertingContext/Kind-swift.enum)

Notification types for specialized handling.

### Configuring notification sound

[`var sound: AlertingContext.Sound?`](/documentation/AccessoryNotifications/AlertingContext/sound-swift.property)

An optional sound configuration for the notification.

[`struct Sound`](/documentation/AccessoryNotifications/AlertingContext/Sound-swift.struct)

A structure that describes sound characteristics for a notification.

## Relationships

### Conforms To

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

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

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

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

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

---

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)