<!--
{
  "availability" : [
    "macOS: 10.8.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSUserNotificationCenter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUserNotificationCenter"
  },
  "title" : "NSUserNotificationCenter"
}
-->

# NSUserNotificationCenter

An object that delivers notifications from apps to the user.

```
class NSUserNotificationCenter
```

## Overview

When a user notification’s delivery date has been reached, or it’s manually delivered, the notification center may display the notification to the user. The user notification center reserves the right to decide if a delivered user notification is presented to the user. For example, it may suppress the notification if the application is already frontmost (the delegate can override this action). The application can check the result of this decision by examining the [`isPresented`](/documentation/Foundation/NSUserNotification/isPresented) property of a delivered user notification.

[`NSUserNotification`](/documentation/Foundation/NSUserNotification) instances the `NSUserNotificationCenter` are tracking will be in one of two states: scheduled or delivered. A scheduled user notification has a [`deliveryDate`](/documentation/Foundation/NSUserNotification/deliveryDate). On that delivery date, the notification will move from being scheduled to being delivered. Note that the user notification may be displayed later than the delivery date depending on many factors.

A delivered user notification has an [`actualDeliveryDate`](/documentation/Foundation/NSUserNotification/actualDeliveryDate). That’s the date when it moved from being scheduled to delivered, or when it was manually delivered using the [`deliver(_:)`](/documentation/Foundation/NSUserNotificationCenter/deliver(_:)) method.

The application and the user notification center are both ultimately subject to the user’s preferences. If the user decides to hide all alerts from your application, the `presented` property will still behave as above, but the user won’t see any animation or hear any sound.

The [`NSUserNotificationCenterDelegate`](/documentation/Foundation/NSUserNotificationCenterDelegate) provides more information about the delivered user notification and allows forcing the display of a user notification even if the application is frontmost.

> Note:
> It the user wakes more than 15 minutes after a scheduled notification is scheduled to fire, it’s discarded. If the notification repeats with an interval less than 15 minutes, then it expires in 1 minute. Expired notifications are just discarded, unless they repeat, in which case, they stay in the scheduled list and just fire again later.

> Important:
> Many of the NSUserNotificationCenter class’s methods involve talking to a server process, so calling them repeatedly can have a negative effect on performance.

### Threading Information

The `NSUserNotificationCenter` class and the [`NSUserNotification`](/documentation/Foundation/NSUserNotification) class are both thread safe.

## Topics

### Creating the Default User Notification Center

[`default`](/documentation/Foundation/NSUserNotificationCenter/default)

Returns the default user notification center.

### Managing the Scheduled Notification Queue

[`scheduleNotification(_:)`](/documentation/Foundation/NSUserNotificationCenter/scheduleNotification(_:))

Schedules the specified user notification.

[`scheduledNotifications`](/documentation/Foundation/NSUserNotificationCenter/scheduledNotifications)

Specifies an array of scheduled user notifications that have not yet been delivered.

[`removeScheduledNotification(_:)`](/documentation/Foundation/NSUserNotificationCenter/removeScheduledNotification(_:))

Removes the specified user notification for the scheduled notifications.

### Managing the Delivered Notifications

[`deliver(_:)`](/documentation/Foundation/NSUserNotificationCenter/deliver(_:))

Deliver the specified user notification.

[`deliveredNotifications`](/documentation/Foundation/NSUserNotificationCenter/deliveredNotifications)

An array of all user notifications delivered to the notification center.

[`removeDeliveredNotification(_:)`](/documentation/Foundation/NSUserNotificationCenter/removeDeliveredNotification(_:))

Remove a delivered user notification from the user notification center.

[`removeAllDeliveredNotifications()`](/documentation/Foundation/NSUserNotificationCenter/removeAllDeliveredNotifications())

Remove all delivered user notifications from the user notification center.

### Getting and Setting the Delegate

[`delegate`](/documentation/Foundation/NSUserNotificationCenter/delegate)

Specifies the notification center delegate.



---

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)