iOS-HIG 系统能力-通知

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.

避免提供破坏性的操作。在一个通知详情视图中提供破坏性的操作前仔细考虑。如果你必须提供它们,确保用户有足够的环境来避免不想要的结果。把破坏性操作标记为红色。


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 202,529评论 5 475
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,015评论 2 379
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 149,409评论 0 335
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,385评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,387评论 5 364
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,466评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,880评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,528评论 0 256
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,727评论 1 295
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,528评论 2 319
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,602评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,302评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,873评论 3 306
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,890评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,132评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,777评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,310评论 2 342

推荐阅读更多精彩内容