Notifications
Last updated
Last updated
Apps can use notifications to provide timely and important information anytime, whether the device is locked or in use. For example, notifications may occur when a message has arrived, an event is about to occur, new data is available, or the status of something has changed. People see notifications on the lock screen, at the top of the screen while using the device, and in Notification Center, which is opened by swiping down from the top edge of the screen. Each notification includes the app name, a small app icon, and a message. Notifications may also be accompanied by a sound, and may cause a badge to appear or update on the corresponding app’s icon.
TIP
Notifications can be local or remote. Local notifications originate and are delivered on the same device. A to-do list app might use local notifications to alert someone about an upcoming meeting or due date. Remote notifications, also called push notifications, come from a server. A multiplayer game might use remote notifications to let players know when it’s their move.
The behavior of notifications is managed in Settings on an app-by-app basis. For any app that supports notifications, you can enable or disable the feature entirely. You can also enable visibility in Notification Center and on the lock screen, enable app icon badging, and choose one of these notification styles:
Banner. Appears at the top of the screen for a few seconds while the device is in use, then disappears.
Alert. Appears at the top of the screen while the device is in use and stays there until manually dismissed.
Tapping a notification when the device is unlocked, or swiping it to the side when the device is locked, dismisses the notification, removes it from Notification Center, opens the corresponding app, and shows related information. Tapping a new email notification on an unlocked device, for example, opens Mail and shows the new message.
On an unlocked device, swiping a notification up or letting it disappear dismisses the notification and may remove it from Notification Center.
Applying pressure to a notification using 3D Touch or, on an unlocked device, swiping a notification down, opens an expanded detail view. This view is customizable and can include up to four buttons for taking action. A to-do list app, for example, might deliver a task notification with a detail view that includes actions for deferring the task and marking it as complete. An Calendar event notification provides a Snooze action that briefly delays the event's alarm.
NOTE
People must explicitly opt into receiving notifications from every app that supports them—they’re asked to do so the first time they use the app. If someone opts out, they can always visit Settings to opt in.
Provide useful, informative notifications. People enable notifications to get quick updates, so focus on providing information of value. Use complete sentences, sentence case, proper punctuation, and don’t truncate your message—the system does this automatically, if necessary. Avoid telling people to open your app, navigate to specific screens, tap specific buttons, and perform other tasks that are hard to remember once the notification is dismissed.
Don’t send multiple notifications for the same thing, even if the user hasn't responded. People attend to notifications at their convenience. If you send multiple notifications for the same thing, you fill up Notification Center, and users may turn off notifications from your app.
Don’t include your app name or icon. The system automatically shows this information at the top of each notification.
Provide descriptive text for display when notification previews are hidden. Based on the user's settings, notification previews may be hidden for privacy. In this case, only your app icon and a generic description (Notification is the default description) are shown. To provide the user with sufficient context, your app should provide custom text that succinctly describes notification content, like Friend Request, New Comment, Reminder, or Shipment. For developer guidance, see hiddenPreviewsBodyPlaceholder.
Provide a sound to supplement your notifications. Sound is a great way to get someone's attention when they’re not looking at the screen. A to-do list app might play an alert sound, for example, when it’s time to perform an important task. Your app can use a custom sound or a built-in alert sound for this. If you use a custom sound, make sure it’s short, distinctive, and professionally produced. See Preparing Custom Alert Sounds in Local and Remote Notification Programming Guide. Keep in mind that people can optionally disable notification alert sounds. They can also enable a vibration that accompanies the sound—this must be manually enabled and can’t be enabled programmatically by your app.
Consider providing a detail view. A notification detail view provides more information about a notification, as well as the ability to take immediate action without leaving the current context to open your app. This view should include useful information, be recognizable, and feel like a natural extension of your app. It can contain photos, videos, and other content, and can be dynamically updated while displayed. For example, a ridesharing app could display a map here that shows a car approaching your current location.
Provide intuitive, beneficial actions. A notification detail view can include up to four action buttons. These buttons should be for performing common, time-saving tasks that eliminate the need to open your app. Use short, title-case names that clearly describe the action results. A notification detail view can also display an onscreen keyboard for collecting information needed to take action. For example, a messaging app might let people respond directly from a new message notification.
Avoid providing destructive actions. Think carefully before providing destructive actions in a notification detail view. If you must provide them, make sure people have enough context to avoid unintended consequences. Actions identified as destructive appear in red.
Use badging to supplement notifications, not to denote critical information. Keep in mind that badging of your app can be turned off. If your app relies on badging to communicate important information, you run the risk of people missing it.
Use badging for notification purposes only. Badges shouldn't be used to display other types of numeric information, such as air quality, dates, stock prices, or weather.
Keep badges up to date. Update your app’s badge as soon as the corresponding information is read. You don’t want people to think there’s new information available, only to find that they’ve already seen it. Note that reducing a badge’s count to zero removes all related notifications from Notification Center.
For developer guidance, see Local and Remote Notification Programming Guide.