apps can use local or push notifications to let people know when interesting things happen, such as:
iOS Technology Usage Guidelines
Notification Center
2013-05-01 | © 2013 Apple Inc. All Rights Reserved.
95
● A message has arrived
● An event is about to occur
● New data is available for download
● The status of something has changed
A local notification is scheduled by an app and delivered by iOS on the same device, regardless of whether
the app is currently running in the foreground. For example, a calendar or to-do app can schedule a local
notification to alert people of an upcoming meeting or due date.
A push notification is sent by an app’s remote server to the Apple Push Notification service, which pushes the
notification to all devices that have the app installed. For example, a game that a user can play against remote
opponents can update all players with the latest move.
You can still receive local and push notifications when your app is running in the foreground, but you pass the
information to your users in an app-specific way.
iOS apps that support local or push notifications can participate in Notification Center in various ways, depending
on the user’s preferences. To ensure that users can customize their notification experience, you should support
as many as possible of the following notification styles:
● Banner
● Alert
● Badge
● Sound
A banner is a small translucent view that appears onscreen and then disappears after a few seconds. In addition
to your notification message, iOS displays the small version of your app icon in a banner, so that people can
see at a glance which app is notifying them (to learn more about the small app icon, see “Small Icons” (page
207)).

iOS Technology Usage Guidelines
Notification Center
2013-05-01 | © 2013 Apple Inc. All Rights Reserved.
96
An alert is a standard alert view that appears onscreen and requires user interaction to dismiss. You supply
the notification message and, optionally, a title for the action button in the alert. You have no control over the
background appearance of the alert or the buttons.

A badge (应用程序icon上的数字标示)is a small red oval that displays the number of pending notification items (a badge appears over the
upper-right corner of an app’s icon). You have no control over the size or color of the badge.无法控制badge的大小和颜色
A custom or system-provided sound can accompany any of the other three notification delivery styles.
Note: Apps that use local notifications can provide banners, alerts, badges, and sounds. But an app
that uses push notifications instead of local notifications can provide only the notification types that
correspond to the push categories for which the app is registered. For example, if a push-notification
app registers for alerts only, users aren’t given the choice to receive badges or sounds when a
notification arrives. 使用push notifications的app只能提供app注册的push categorres对应的notification类型即如果一个app

注册时仅仅有alerts,那么当有通知时就不会出现badges或者sounds

As you design the content that your notifications can deliver, be sure to observe the following guidelines.
Keep badge contents up to date. It’s especially important to update the badge as soon as users have attended
to the new information, so that they don’t think additional notifications have arrived. Note that setting the
badge contents to zero also removes the related notification items from Notification Center.
iOS Technology Usage Guidelines
Notification Center
2013-05-01 | © 2013 Apple Inc. All Rights Reserved.
97
Important: Don’t use a badge for purposes other than notifications.尽量使用通知而不是badge Remember that users can turn off
badging for your app, so you can’t be sure that they will see the content in a badge.
Don’t send multiple notifications for the same event. Users can attend to notification items when they
choose; the items don’t disappear until users handle them in some way. If you send multiple notifications for
the same event, you fill up the Notification Center list and users are likely to turn off notifications from your
app.
Provide a custom message that does not include your app name.在alert message中不要添加app的名字,因为ios会自动显示名字 Your custom message is displayed in alerts
and banners, and in Notification Center list items. You should not include your app’s name in your custom
message because iOS automatically displays the name with your message.
To be useful, a local or push notification message should:
● Focus on the information, not user actions. Avoid telling people which alert button to tap or how to open
your app.
● Be short enough to display on one or two lines. Long messages are difficult for users to read quickly, and
they can force alerts to scroll.
● Use sentence-style capitalization and appropriate ending punctuation. When possible, use a complete
sentence.
Note: In general, a Notification Center item can display more of a notification message than a banner
can. If necessary, iOS truncates your message so that it fits well in each notification delivery style;
for best results, you shouldn’t truncate your message.
Optionally, provide a custom title for the action button in an alert. An alert can contain one or two buttons.
In a two-button alert, the Close button is on the left and the action button (titled View by default) is on the
right. If you specify one button, the alert displays an OK button.
Tapping the action button dismisses the alert and launches your app simultaneously. Tapping either the Close
button or the OK button dismisses the alert without opening your app.
If you want to use a custom title for the action button, be sure to create a title that clearly describes the action
that occurs when your app launches. For example, a game might use the title Play to indicate that tapping the
button opens the app to a place where the user can take their turn. Make sure the title:
● Uses title-style capitalization
● Is short enough to fit in the button without truncation (be sure to test the length of localized titles, too)
iOS Technology Usage Guidelines
Notification Center
2013-05-01 | © 2013 Apple Inc. All Rights Reserved.
98
Note: Your custom button title can also be displayed in the “slide to view” message people see
when a notification arrives while the device is locked. When this happens, your custom title is
automatically converted to lowercase and replaces the word “view” in the message.
Provide a sound that users can choose to hear when a notification arrives. A sound can get people’s attention
when they’re not looking at the device screen. Users might want to enable sounds when they’re expecting a
notification that they consider important. For example, a calendar app might play a sound with an alert that
reminds people about an imminent event. Or, a collaborative task management app might play a sound with
a badge update to signal that a remote colleague has completed an assignment.
You can supply a custom sound, or you can use a built-in alert sound. If you create a custom sound, be sure
it’s short, distinctive, and professionally produced. (To learn about the technical requirements for this sound,
see “Preparing Custom Alert Sounds” in Local and Push Notification Programming Guide .) Note that you can’t
programmatically cause the device to vibrate when a notification is delivered, because the user has control
over whether alerts are accompanied by vibration.
Optionally, provide a launch image. In addition to displaying your existing launch images, you can supply a
different launch image to display when people start your app in response to a notification. For example, a
game might specify a launch image that’s similar to a screen within the game, instead of an image that’s similar
to the opening menu screen. If you don’t supply this launch image, iOS displays either the previous snapshot
or one of your other launch images. (To learn how to create a launch image, see “Launch Images” (page 204).)

ios notification的更多相关文章

  1. iOS - Notification 通知

    1.Notification 通知中心实际上是在程序内部提供了消息广播的一种机制,它允许我们在低程度耦合的情况下,满足控制器与一个任意的对象进行通信的目的.每一个 iOS 程序(即每一个进程)都有一个 ...

  2. iOS Notification – 远程通知

    本文讲解iOS的远程通知的基本使用,主要包括远程通知的类型,处理远程通知的场景,以及远程通知相关证书的配置等等. 一.APNs简介 APNs是苹果公司提供的远程通知的服务器,当App处于后台或者没有运 ...

  3. iOS Notification 的使用

    Notification post notification,notification,notification,notification,notification,n otification ,no ...

  4. IOS Notification 通知中心

    1.     通知中心概述 通知中心实际上是在程序内部提供了消息广播的一种机制.通知中心不能在进程间进行通信.实际上就是一个二传手,把接收到的消息,根据内部的一个消息转发表,来将消息转发给需要的对象. ...

  5. 7.iOS Notification

    1. 通知中心认识 通知中心实际上是在程序内部提供了消息广播的一种机制.通知中心不能在进程间进行通信,它只能进行程序内部通信,不能跨应用程序进程通信.通知中心,当通知中心接受到消息后会根据设置,根据内 ...

  6. Android Broadcast 和 iOS Notification

    感觉以上2个机能有许多相似之处,作个记录,待研究!

  7. iOS.Notification.Bar.Color

    Reference: http://apple.stackexchange.com/questions/44246/what-determines-the-special-color-of-the-s ...

  8. Send Push Notifications to iOS Devices using Xcode 8 and Swift 3, APNs Auth Key

    Send Push Notifications to iOS Devices using Xcode 8 and Swift 3 OCT 6, 2016 Push notifications are ...

  9. iOS.OpenSource.AllInOne

    Open Source Project for iOS 所有和iOS相关的Open Source Project的汇总. 功能点 开源项目   iOS Gallery RMGallery https: ...

随机推荐

  1. C# Winform打包部署时添加注册表信息实现开机启动(转载)

    使用VS自带的打包模块可以很方便的对项目进行打包部署,同时我们也可以在安装部署时操作注册表实现开机启动软件.具体实现如下:    1.添加安装部署项目后,鼠标右键安装项目->视图->注册表 ...

  2. DownloadManager的使用

    DownloadManager是系统开放给第三方应用使用的类,包含两个静态内部类DownloadManager.Query和DownloadManager.Request.DownloadManage ...

  3. ansible中playbook使用

    palybook使用 ####yaml语法ansible中使用的yaml基础元素:变量Inventory条件测试迭代 playbook的组成结构InventoryModulesAd Hoc Comma ...

  4. NSURLSession使用模板和AFNetworking使用模板(REST风格)

    1.NSURLSession使用模板 NSURLSession是苹果ios7后提供的api,用来替换 NSURLConnection会话指的是程序和服务器的通信对象//一.简单会话不可以配合会话(ge ...

  5. 【bzoj1822】[JSOI2010]Frozen Nova 冷冻波 计算几何+二分+网络流最大流

    题目描述 WJJ喜欢“魔兽争霸”这个游戏.在游戏中,巫妖是一种强大的英雄,它的技能Frozen Nova每次可以杀死一个小精灵.我们认为,巫妖和小精灵都可以看成是平面上的点. 当巫妖和小精灵之间的直线 ...

  6. 【bzoj2096】[Poi2010]Pilots 双指针法+STL-set

    题目描述 Tz又耍畸形了!!他要当飞行员,他拿到了一个飞行员测试难度序列,他设定了一个难度差的最大值,在序列中他想找到一个最长的子串,任意两个难度差不会超过他设定的最大值.耍畸形一个人是不行的,于是他 ...

  7. 编译静态库tinyxml2

    tinyxml的makefile文件默认是编译可执行的二进制文件xmltest.  需要改成静态库. 更改OUTPUT := xmltest 为:OUTPUT := libtinyxml.a 删除SR ...

  8. [BZOJ2036]聪明的阿卑多

    [BZOJ2036]聪明的阿卑多 试题描述 也许你从没听说过阿卑多,但你一定知道他爷爷的爷爷的爷爷,那就是聪明绝顶的阿凡提先生.是的,阿卑多也是个聪明的小孩. 一天,阿卑多骑着他的小毛驴,在小镇上晃悠 ...

  9. 论文笔记:《OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks DeepLearning 》

    一.Abstract综述 训练出一个CNN可以同时实现分类,定位和检测..,三个任务共用同一个CNN网络,只是在pool5之后有所不同 二.分类 这里CNN的结构是对ALEXNET做了一些改进,具体的 ...

  10. php合并图片

    <?php class image{ /** * @param string $backgroundImage 背景图 * @param string $smallImage 小图 * @par ...