Contents

User Notifications

Push user-facing notifications to the user’s device from a server, or generate them locally from your app.

Overview

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.

[Image]

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, your company’s server generates push notifications, and Apple Push Notification service (APNs) handles the delivery of those notifications to the user’s devices.

Use this framework to do the following:

  • 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.

The system makes every attempt to deliver local and remote notifications in a timely manner, but delivery isn’t guaranteed. The PushKit framework offers a more timely delivery mechanism for specific types of notifications, such as those VoIP and watchOS complications use. For more information, see PushKit.

For webpages in Safari version 16.0 and higher, generate remote notifications from a server that you manage using Push API code that works in Safari and other browsers.

For design guidance, see Human Interface Guidelines > Notifications.

Topics

Essentials

Notification management

Remote notifications

Notification requests

Web push notifications

Notification content

Triggers

Notification categories and user actions

Notification responses

Notification service app extension

Entitlements

Sample code

Classes