Push user-facing notifications to the user's device from a server, or generate them locally from your app.
- iOS 10.0+
- macOS 10.14+
- tvOS 10.0+
- watchOS 3.0+
User-facing notifications communicate important information to users of your app, regardless of whether your app is running on the user's device. For example, a sports app can let the user know when their favorite team scores. Notifications can also tell your app to download information and update its interface. Notifications can display an alert, play a sound, or badge the app's icon.
You can generate notifications locally from your app or remotely from a server that you manage. For local notifications, the app creates the notification content and specifies a condition, like a time or location, that triggers the delivery of the notification. For remote notifications (also known as push notifications), you use one of your company's servers to generate notifications, and Apple Push Notification service (APNs) handles the delivery of those notifications to the user's devices.
Use this framework to:
Define the types of notifications that your app supports.
Define any custom actions associated with your notification types.
Schedule local notifications for delivery.
Process already delivered notifications.
Respond to user-selected actions.