<!--
{
  "availability" : [
    "iOS: 4.0.0 - 10.0.0",
    "iPadOS: 4.0.0 - 10.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "tvOS: -",
    "visionOS: -",
    "watchOS: 2.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UILocalNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UILocalNotification"
  },
  "title" : "UILocalNotification"
}
-->

# UILocalNotification

A notification that an app can schedule for presentation at a specific date and time.

```
@MainActor class UILocalNotification
```

## Overview

The operating system is responsible for delivering local notifications at their scheduled times; the app does not have to be running for this to happen. Although local notifications are similar to remote notifications in that they are used for displaying alerts, playing sounds, and badging app icons, they are composed and delivered locally and do not require connection with remote servers.

Local notifications are primarily intended for apps with timer-based behaviors and simple calendar or to-do list apps. An app that is running in the background may also schedule a local notification to inform the user of an incoming message, chat, or update. An app can have only a limited number of scheduled notifications; the system keeps the soonest-firing 64 notifications (with automatically rescheduled notifications counting as a single notification) and discards the rest.

When you create a local notification, you must specify either a specific date or a geographic region as the trigger for delivering the notification. Date-based notifications are delivered at the day and time you specify, and allowances can be made for time zone changes as needed. Region-based notifications are delivered when the user enters or exits the specified region. In both cases, you can specify whether the notifications are one-time events or can be rescheduled and delivered again.

After creating a `UILocalNotification` object, schedule it using either the [`scheduleLocalNotification(_:)`](/documentation/UIKit/UIApplication/scheduleLocalNotification(_:)) or [`presentLocalNotificationNow(_:)`](/documentation/UIKit/UIApplication/presentLocalNotificationNow(_:)) method of the [`UIApplication`](/documentation/UIKit/UIApplication) class. The [`scheduleLocalNotification(_:)`](/documentation/UIKit/UIApplication/scheduleLocalNotification(_:)) method uses the fire date to schedule delivery; the [`presentLocalNotificationNow(_:)`](/documentation/UIKit/UIApplication/presentLocalNotificationNow(_:)) method presents the notification immediately, regardless of the value of `fireDate`. You can cancel one or more local notifications using the [`cancelLocalNotification(_:)`](/documentation/UIKit/UIApplication/cancelLocalNotification(_:)) or [`cancelAllLocalNotifications()`](/documentation/UIKit/UIApplication/cancelAllLocalNotifications()) method of the [`UIApplication`](/documentation/UIKit/UIApplication) object.

When the system delivers a local notification, several things can happen, depending on the app state and the type of notification. If the app is not frontmost and visible, the system displays the alert message, badges the app, and plays a sound—whatever is specified in the notification. If the notification is an alert and the user taps the action button (or, if the device is locked, drags open the action slider), the app is woken up or launched. (If the user taps one of the custom actions you specify using the [`category`](/documentation/UIKit/UILocalNotification/category) property, the app is woken up or launched into the background.) In its [`application(_:didFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFinishLaunchingWithOptions:)) method, the app delegate can obtain the `UILocalNotification` object from the launch options dictionary using the [`localNotification`](/documentation/UIKit/UIApplication/LaunchOptionsKey/localNotification) key. The delegate can inspect the properties of the notification and, if the notification includes custom data in its [`userInfo`](/documentation/UIKit/UILocalNotification/userInfo) dictionary, it can access that data and process it accordingly. On the other hand, if the local notification only badges the app icon, and the user in response launches the app, the [`application(_:didFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFinishLaunchingWithOptions:)) method is called, but no `UILocalNotification` object is included in the options dictionary. When the user selects a custom action, the app delegate’s [`application(_:handleActionWithIdentifier:for:completionHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handleActionWithIdentifier:for:completionHandler:)) method is called to handle the action.

If the app is foremost and visible when the system delivers the notification, the app delegate’s [`application(_:didReceive:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didReceive:)) is called to process the notification. Use the information in the provided `UILocalNotification` object to decide what action to take. The system does not display any alerts, badge the app’s icon, or play any sounds when the app is already frontmost.

An app is responsible for managing the badge number displayed on its icon. For example, if a text-messaging app processes all incoming messages after receiving a local notification, it should remove the icon badge by setting the [`applicationIconBadgeNumber`](/documentation/UIKit/UIApplication/applicationIconBadgeNumber) property of the [`UIApplication`](/documentation/UIKit/UIApplication) object to 0.

## Topics

### Scheduling a local notification

[`fireDate`](/documentation/UIKit/UILocalNotification/fireDate)

The date and time when the system should deliver the notification.

[`timeZone`](/documentation/UIKit/UILocalNotification/timeZone)

The time zone of the notification’s fire date.

[`repeatInterval`](/documentation/UIKit/UILocalNotification/repeatInterval)

The calendar interval at which to reschedule the notification.

[`repeatCalendar`](/documentation/UIKit/UILocalNotification/repeatCalendar)

The calendar the system should refer to when it reschedules a repeating notification.

[`region`](/documentation/UIKit/UILocalNotification/region)

The geographic region that triggers the notification.

[`regionTriggersOnce`](/documentation/UIKit/UILocalNotification/regionTriggersOnce)

A Boolean value indicating whether crossing a geographic region boundary delivers only one notification.

### Composing the alert

[`alertBody`](/documentation/UIKit/UILocalNotification/alertBody)

The message displayed in the notification alert.

[`alertAction`](/documentation/UIKit/UILocalNotification/alertAction)

The title of the action button or slider.

[`alertTitle`](/documentation/UIKit/UILocalNotification/alertTitle)

A short description of the reason for the alert.

[`hasAction`](/documentation/UIKit/UILocalNotification/hasAction)

A Boolean value that controls whether the notification shows or hides the alert action.

[`alertLaunchImage`](/documentation/UIKit/UILocalNotification/alertLaunchImage)

Identifies the image used as the launch image when the user taps (or slides) the action button (or slider).

[`category`](/documentation/UIKit/UILocalNotification/category)

The name of a group of actions to display in the alert.

### Configuring other parts of the notification

[`applicationIconBadgeNumber`](/documentation/UIKit/UILocalNotification/applicationIconBadgeNumber)

The number to display as the app’s icon badge.

[`soundName`](/documentation/UIKit/UILocalNotification/soundName)

The name of the file containing the sound to play when an alert is displayed.

[`userInfo`](/documentation/UIKit/UILocalNotification/userInfo)

A dictionary for passing custom information to the notified app.

### Constants

[Notification sound](/documentation/UIKit/notification-sound)

The default system sound for local notifications.

### Initializers

[`init()`](/documentation/UIKit/UILocalNotification/init())

[`init(coder:)`](/documentation/UIKit/UILocalNotification/init(coder:))



---

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)
