<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UserNotifications",
  "identifier" : "/documentation/UserNotifications/UNError/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "User Notifications"
    ],
    "preciseIdentifier" : "c:@E@UNErrorCode"
  },
  "title" : "UNError.Code"
}
-->

# UNError.Code

Constants that identify notification errors.

```
enum Code
```

## Topics

### Constants

[`UNError.Code.notificationsNotAllowed`](/documentation/UserNotifications/UNError/Code/notificationsNotAllowed)

Notifications aren’t allowed.

[`UNError.Code.attachmentInvalidURL`](/documentation/UserNotifications/UNError/Code/attachmentInvalidURL)

The URL for an attachment was invalid.

[`UNError.Code.attachmentUnrecognizedType`](/documentation/UserNotifications/UNError/Code/attachmentUnrecognizedType)

The file type of an attachment isn’t supported.

[`UNError.Code.attachmentInvalidFileSize`](/documentation/UserNotifications/UNError/Code/attachmentInvalidFileSize)

An attachment is too large.

[`UNError.Code.attachmentNotInDataStore`](/documentation/UserNotifications/UNError/Code/attachmentNotInDataStore)

The specified attachment isn’t in the system data store.

[`UNError.Code.attachmentMoveIntoDataStoreFailed`](/documentation/UserNotifications/UNError/Code/attachmentMoveIntoDataStoreFailed)

An error occurred when trying to move an attachment to the system data store.

[`UNError.Code.attachmentCorrupt`](/documentation/UserNotifications/UNError/Code/attachmentCorrupt)

The file for an attachment is corrupt.

[`UNError.Code.notificationInvalidNoDate`](/documentation/UserNotifications/UNError/Code/notificationInvalidNoDate)

The notification doesn’t have an associated date, but should.

[`UNError.Code.notificationInvalidNoContent`](/documentation/UserNotifications/UNError/Code/notificationInvalidNoContent)

The notification has no user-facing content, but should.

[`UNError.Code.contentProvidingInvalid`](/documentation/UserNotifications/UNError/Code/contentProvidingInvalid)

[`UNError.Code.contentProvidingObjectNotAllowed`](/documentation/UserNotifications/UNError/Code/contentProvidingObjectNotAllowed)

### Enumeration Cases

[`UNError.Code.badgeInputInvalid`](/documentation/UserNotifications/UNError/Code/badgeInputInvalid)



---

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)