Sent to the delegate when a running app receives a local notification.
- iOS 4.0–10.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
The app object that received the local notification.
A local notification that encapsulates details about the notification, potentially including custom data.
Local notifications are similar to remote notifications, but differ in that they are scheduled, displayed, and received entirely on the same device. An app can create and schedule a local notification, and the operating system then delivers it at the scheduled date and time. If the app is not active in the foreground when the notification fires, the system uses the information in the
UILocal object to determine whether it should display an alert, badge the app icon, or play a sound. If the app is running in the foreground, the system calls this method directly without alerting the user in any way.
You might implement this method in your delegate if you want to be notified that a local notification occurred. For example, a calendar app might use local notifications to alert the user to upcoming events.
If the user chooses to open the app when a local notification occurs, the launch options dictionary passed to the
application(_: methods contains the
local key. This method is called at some point after your delegate’s