iOS8和iOS7推送通知有效负载

问题描述:

由于iOS8提出了交互式通知,是否有任何重大更改使Payload发送推送通知?如果有更改,那么在较低版本的iOS中如何处理它?

Since iOS8 came up with interactive notification, is there any significant changes to make Payload to send push notification? If changes are there then how it will be handled in lower versions of iOS?

给定的有效载荷存在细微差别。但是,相同的交互式通知有效负载可以推送到iOS7或更低,它将显示为正常通知。

There is a small difference in payloads as given. However same interactive notification payload can be pushed to iOS7 or less, it will be shown as normal notification.


iOS8交互式推送有效负载



{"aps":{"alert":"Hello Testing","badge":1,"sound":"default","category":"your_category_key"}}

your_category_key只是 UIMutableUserNotificationCategory 标识符。

"your_category_key" is nothing but the UIMutableUserNotificationCategory identifier.


旧版本低于iOS8有效载荷



{"aps":{"alert":"Hello Testing","badge":1,"sound":"default"}}

Apple已将有效负载大小扩展到2048字节(2K)。以前只有256字节。

And Apple has extended the payload size up to 2048 Bytes (2K). Previously it was 256 Bytes only.