用于移动推送通知的AWS SNS的最大有效负载长度是多少? [英] What is the maximum payload length of AWS SNS for mobile push notifications?

查看:105
本文介绍了用于移动推送通知的AWS SNS的最大有效负载长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AWS SNS的常​​见问题解答中,他们提到:

On the FAQ of AWS SNS they have mentioned that:

除SMS消息外,Amazon SNS消息最多可包含256 KB文本数据,包括XML,JSON和未格式化的文本.

With the exception of SMS messages, Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text.

问:SNS主题如何与Mobile Push一起使用?

Q: How do SNS topics work with Mobile Push?

SNS主题可以使订阅者来自任何受支持的推送通知平台以及任何其他终结点类型,例如SMS或电子邮件.当您将通知发布到主题时,SNS会将该消息的相同副本发送到订阅该主题的每个端点.如果使用特定于平台的有效负载来定义发送到每个推送平台的确切负载,则发布将超过相关推送通知平台强加的最大负载大小,否则发布将失败.

SNS topics can have subscribers from any supported push notifications platform, as well as any other endpoint type such as SMS or email. When you publish a notification to a topic, SNS will send identical copies of that message to each endpoint subscribed to the topic. If you use platform-specific payloads to define the exact payload sent to each push platform, the publish will fail if it exceeds the maximum payload size imposed by the relevant push notifications platform.

问:各种目标平台支持什么有效负载大小?

Q: What payload size is supported for various target platforms?

SNS将支持底层本机平台支持的最大有效负载大小.客户可以使用JSON对象发送特定于平台的消息.有关其他详细信息,请参见使用SNS Mobile Push API.

SNS will support maximum payload size that is supported by the underlying native platform. Customers can use a JSON object to send platform specific messages. See Using SNS Mobile Push API for additional details.

https://aws.amazon.com/sns/faqs/

我的问题是,如果通过GCM和APN传递的有效载荷消息的长度受到限制,我可以使用SNS向移动设备发送256KB的有效载荷吗?

My question is can I send 256KB payload using SNS to mobile devices if there are limits on the lengths of payload messages delivered through GCM and APN?

通过SNS主题发送的这些通知是否可以在尚未运行的情况下唤醒应用程序?

Can these notifications sent via SNS topic wake up the app if it's not already running?

推荐答案

按照常见问题解答-移动推送通知:

SNS将支持底层本机平台.客户可以使用JSON对象发送平台特定的消息.请参阅将SNS移动推送API用于其他详细信息.

SNS will support maximum payload size that is supported by the underlying native platform. Customers can use a JSON object to send platform specific messages. See Using SNS Mobile Push API for additional details.

并且按照(例如) Apple的PUSH通知文档:<

不得将JSON有效负载压缩并且将其限制为最大大小为4 KB(4096字节).对于基于Internet协议的语音(VoIP)通知,最大大小为5 KB(5120字节)

The JSON payload must not be compressed and is limited to a maximum size of 4 KB (4096 bytes). For a Voice over Internet Protocol (VoIP) notification, the maximum size is 5 KB (5120 bytes)

因此,如果您正在使用SNS通过Apple APNS将推送通知发送到移动设备您需要检查有效载荷不超过4KB.特别是在SNS推送通知中发送对象和消息时相关.

So if you are using SNS to send push notifications to mobile devices via apple APNS you would want to check that the payload does not exceed 4KB. This is especially relevant when you are sending an object along with your message in an SNS push notification.

这篇关于用于移动推送通知的AWS SNS的最大有效负载长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆