Notifications
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.
app可以随时通知来提供及时和重要信息,无论设备是否锁定或在使用。例如,通知可能发生在接收到消息时,一个事件即将发生,新数据可用,或者某物的状态已经改变。用户看见通知在锁定的屏幕,当在使用设备时在屏幕的顶部,在通知中心,通过从屏幕顶部边缘向下滑出现。每个通知包括app名字,一个app小图标,和一条信息。通知也许伴随着一个声音,也许引起出现一个白色徽章在app 图标图标之上。
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:
通知的行为在设置中基于app管理。对于任何支持通知的app,你可以启用或者禁用整个特性。你可以在通知中心显示,在锁屏屏幕上,启用app 图标徽章,选择以下其中一种通知样式。
*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.
在通知上使用3D Touch,在一台未锁定的设备,向下滑动通知,打开一个展开的详情视图。这个是可定制的,可以包括4个按钮来执行操作。一个待办清单app,例如,也许传达一个带详情视图的任务通知,包括推迟任务和标记它完成的操作。
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.
提示 通知可以是本地的或者远程的。本地通知发生和传递在同一个设备。一个待办清单app也许使用本地提醒来提醒某人一个即将到来的会议或者约会日期。远程提醒,也推送通知,从一个服务器推送。一个多角色游戏也许使用远程通知让玩家知道他们什么时候行动。
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.
用户必须显式选择进入收到的来自每个支持他们的app的通知-在他们第一次使用app时被要求这样做。如果某人选择退出,他们可以一直Setting来进入。
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.
提供有用的,有益的通知。用户启用通知来获得快速更新,这样专注提供有价值的信息。使用完成的语句,句子首字母大写,合适的标点,不要截短你的信息-系统自动这样做,如果必须。避免告诉用户去打开你的app,导航到特定的屏幕,敲击特定按钮,执行其他任务,一旦离开通知很难记住。
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.
不要为同一件事发送多条通知,即使用户没有回应。用户方便时才响应通知。如果你为同一件事发送多条通知,填满通知中心,用户也许会关闭你的app通知。
Don’t include your app name or icon.The system automatically shows this information at the top of each notification.
不要包括你app或者图标。系统自动在每个通知顶部显示这些信息。
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.
使用徽章来补充通知,不需要贡献具体信息。记住你的app徽章可以被关闭。如果你的app依赖徽章来沟通重要信息,你的用户可以能丢失它。
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.
保持徽章更新。当相关信息被阅读时及时更新你的app徽章信息。你不会想知户知道还有新的信息时,结果发现只是些他们已经读过的信息。
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. SeePreparing Custom Alert SoundsinLocal 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.
提供一个声音来支持你的通知。声音是一个很好的方式来让获得用户的注意力当他们没有在看屏幕时。一个待办列表app也许会播放一个提醒声音,例如,当是时候执行一个重要任务时。你的app可以为它使用一个定制的声音或者一个内置的提醒声音。如果你使用一个定制的声音,确保它是简短的,特别的,和专门被制造的。SeePreparing Custom Alert SoundsinLocal and Remote Notification Programming Guide.记住用户可以选择关闭提醒声。他们也可以激活一个震动伴随这个声音-这必须手动来启用,不能被你的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.
考虑提供一个详情视图。一个通知详情视图提供通知的更多信息,这样就不需要离开当前环境来打开你的app。这个视图必须包括有用的信息,可被识别,感到是你的app自然延伸。它可以包括照片,视频,和其他内容,当被播放时可以被动态更新。例如,一款骑行分享app可以显示一个地图来显示到你的目的地行车路径。
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.
提供直观的,有用的操作。一个通知详情视图可以包括多达4个操作按钮。这些按钮可以用来执行一般,省时的任务来减少需要打开你的app必要性。使用简单,标题大写的名字来清晰描述动作结果。一个通知详情视图也可以显示一个键盘来收集信息来完成操作。例如,一个信息app也许让用户直接在新消息通知的界面直接回复。
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.
避免提供破坏性的操作。在一个通知详情视图中提供破坏性的操作前仔细考虑。如果你必须提供它们,确保用户有足够的环境来避免不想要的结果。把破坏性操作标记为红色。