https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW1

APS Dictionary Keys

The aps dictionary contains the keys used by Apple to deliver the notification to the user’s device. The keys specify the type of interactions that you want the system to use when alerting the user. Table 9-1 lists the keys to include in this dictionary along with the type of information to include in each. Any other keys in the aps dictionary are ignored by Apple.

Table 9-1Keys and values of the aps dictionary

Key

Value type

Comment

alert

Dictionary or String

Include this key when you want the system to display a standard alert or a banner. The notification settings for your app on the user’s device determine whether an alert or banner is displayed.

The preferred value for this key is a dictionary, the keys for which are listed in Table 9-2. If you specify a string as the value of this key, that string is displayed as the message text of the alert or banner.

The JSON \U notation is not supported. Put the actual UTF-8 character in the alert text instead.

badge

Number

Include this key when you want the system to modify the badge of your app icon.

If this key is not included in the dictionary, the badge is not changed. To remove the badge, set the value of this key to 0.

sound

String

Include this key when you want the system to play a sound. The value of this key is the name of a sound file in your app’s main bundle or in the Library/Sounds folder of your app’s data container. If the sound file cannot be found, or if you specify defaultfor the value, the system plays the default alert sound.

For details about providing sound files for notifications; see Preparing Custom Alert Sounds.

content-available

Number

Include this key with a value of 1 to configure a silent notification. When this key is present, the system wakes up your app in the background and delivers the notification to its app delegate. For information about configuring and handling silent notifications, see Configuring a Silent Notification.

category

String

Provide this key with a string value that represents the notification’s type. This value corresponds to the value in the identifierproperty of one of your app’s registered categories. To learn more about using custom actions, see Configuring Categories and Actionable Notifications.

thread-id

String

Provide this key with a string value that represents the app-specific identifier for grouping notifications. If you provide a Notification Content app extension, you can use this value to group your notifications together. For local notifications, this key corresponds to the threadIdentifier property of the UNNotificationContent object.

Alert Keys

Table 9-2 lists the keys and expected values for the alert dictionary.

Table 9-2Child properties of the alert property

Key

Value type

Comment

title

String

A short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. This key was added in iOS 8.2.

body

String

The text of the alert message.

title-loc-key

String or null

The key to a title string in the Localizable.strings file for the current localization. The key string can be formatted with %@ and %n$@ specifiers to take the variables specified in the title-loc-argsarray. See Localizing the Content of Your Remote Notifications for more information. This key was added in iOS 8.2.

title-loc-args

Array of strings or null

Variable string values to appear in place of the format specifiers in title-loc-key. See Localizing the Content of Your Remote Notifications for more information. This key was added in iOS 8.2.

action-loc-key

String or null

If a string is specified, the system displays an alert that includes the Close and View buttons. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. See Localizing the Content of Your Remote Notifications for more information.

loc-key

String

A key to an alert-message string in a Localizable.strings file for the current localization (which is set by the user’s language preference). The key string can be formatted with %@ and %n$@ specifiers to take the variables specified in the loc-args array. See Localizing the Content of Your Remote Notifications for more information.

loc-args

Array of strings

Variable string values to appear in place of the format specifiers in loc-key. See Localizing the Content of Your Remote Notifications for more information.

launch-image

String

The filename of an image file in the app bundle, with or without the filename extension. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot, uses the image identified by the UILaunchImageFile key in the app’s Info.plist file, or falls back to Default.png.

ios push Payload的更多相关文章

  1. iOS - Push 通知推送

    1.UserNotifications 通知是 App 用来和用户交流的一种方式,特别是当 App 并没有在前台运行的时候.通知,正如它的名称所强调的,被用作向用户'通知'一个事件,或者仅仅向用户提示 ...

  2. 苹果推送(APNs)ios push小结

    把app删除后就推送不成功了,可以看出deviceToken应该是设备+app来一起识别的,重新安装后仍然为同一个 简介 推送服务APNs(Apple Push Notification servic ...

  3. IOS PUSH 实践操作~~~~

    1.推送过程简介        (1)App启动过程中,使用UIApplication::registerForRemoteNotificationTypes函数与苹果的APNS服务器通信,发出注册远 ...

  4. iOS Push详述,了解一下?

    WeTest 导读 本文主要对iOS Push的在线push.本地push及离线(远程)push进行梳理,介绍了相关逻辑,测试时要注意的要点以及相关工具.小小的Push背后蕴藏着大大的逻辑! Push ...

  5. 了解iOS消息推送一文就够:史上最全iOS Push技术详解

    本文作者:陈裕发, 腾讯系统测试工程师,由腾讯WeTest整理发表. 1.引言 开发iOS系统中的Push推送,通常有以下3种情况: 1)在线Push:比如QQ.微信等IM界面处于前台时,聊天消息和指 ...

  6. iOS push过去的时候界面不能完全退出

    iOS push过去的时候界面不能完全退出 解决方法:设置self.view.backgroundcolor 1. initWithFrame方法是什么?  initWithFrame方法用来初始化并 ...

  7. iOS push全方位解析(二)【译文】"——生成OpenSSL证书,Provisioning Profile

    这是一篇来自raywenderlich的教程,内容翔实!结构简单透彻.讲解循序渐进.文章质量上乘!是一篇难的的博文!使用半瓶的英语水平翻译了一下: 1.[iOS push全方位解析](一) push的 ...

  8. [转]ios push

    转:http://blog.csdn.net/showhilllee/article/details/8631734 APNS的推送机制 首先我们看一下苹果官方给出的对ios推送机制的解释.如下图 P ...

  9. IOS PUSH

    第一阶段:.net应用程序把要发送的消息.目的iPhone的标识打包,发给APNS. 第二阶段:APNS在自身的已注册Push服务的iPhone列表中,查找有相应标识的iPhone,并把消息发到iPh ...

随机推荐

  1. struts2-045漏洞浅析

    http://blog.csdn.net/rossrocket/article/details/67674290

  2. Flutter从入门到进阶实战携程网App_汇总贴

    视频地址:https://coding.imooc.com/class/321.html?mc_marking=60e5294c605a87b2af7257d06f70505e&mc_chan ...

  3. ajaxForm上传文件到本地服务器(封装)

    不啰嗦,直接看代码 1.html: <div class="con-item fix"> <span class="f">文章封面< ...

  4. HDU 1556【线段树区间更新】

    这篇lazy讲的很棒: https://www.douban.com/note/273509745/ if(tree[rt].l == l && r == tree[rt].r) 这里 ...

  5. shader实例(二十二)TexGen-球面贴图SphereMap

    http://blog.sina.com.cn/s/blog_89d90b7c0102vfqz.html 球面贴图一般用于环境反射,如下图(左边为球面贴图,右边为正常贴图),一个镜面水晶球在这只猫的前 ...

  6. LED与OLED的区别:

    LED与OLED的区别: led和oled的发光原理是一样的,只 不过区别是用的材料不一样led用的是金属材料,而oled用的是有机物材料. OLED不需要背光源,自己本身会发光,是采用发光二极管阵列 ...

  7. Unity3D研究院之手游开发中所有特殊的文件夹

    这里列举出手游开发中用到了所有特殊文件夹. 1.Editor Editor文件夹可以在根目录下,也可以在子目录里,只要名子叫Editor就可以.比如目录:/xxx/xxx/Editor  和 /Edi ...

  8. Bloomberg Desktop Api 关于历史Tick数据的一些参考

    使用WAPI命令可以看到当前BBG的Api情况. 目前2016年3月是V3的版本.其中有一个API Develper's Guide 中有Core Develper Guide的pdf, 里面提到了B ...

  9. [Xcode 实际操作]二、视图与手势-(7)UIView视图的渐变填充

    目录:[Swift]Xcode实际操作 本文将演示创建一个具有渐变填充色的图形 import UIKit class ViewController: UIViewController { overri ...

  10. 考虑实现Comparable接口

    考虑实现Comparable接口   compareTo方法没有在Object中声明.相反,它是Comparable接口中唯一的方法.compareTo方法不但允许进行简单的等同性比较,而且允许执行顺 ...