简体   繁体   English

IBM Worklight:iOS推送通知长度限制

[英]IBM Worklight: iOS Push Notification Length Limit

From Apple specification, the maximum payload of push notification message is 256 bytes. 根据Apple规范,推送通知消息的最大有效负载为256个字节。 Normally, the minimum payload should be {"aps":{"alert":""}} which have taken 20 bytes. 通常,最小有效负载应为{"aps":{"alert":""}} ,该有效负载已占用20个字节。 So, the maximum number of bytes in message should be 236 bytes. 因此,消息中的最大字节数应为236个字节。

From Worklight perspective, what will be the minimum payload of the push notification message? 从Worklight的角度来看,推送通知消息的最小有效负载是多少? As I am not sure whether it will append something like sound: null or the event source name to the payload or not. 由于我不确定是否会在sound: null后面添加sound: null或事件源名称。 Ultimately I would like to derive number of bytes which can be sent through APNS in Worklight. 最终,我想导出可以通过Worklight中的APNS发送的字节数。

Thanks a lot. 非常感谢。

When sending a simple push notification with a message only, the max length of your message is, deterministically, 236 characters. 当仅发送带有消息的简单推送通知时,确定地,消息的最大长度为236个字符。

Your payload is that JSON string, which must be 256 characters. 您的有效载荷是该JSON字符串,必须为256个字符。 Apple does not change your JSON or interfere with the packet, so you are in control of the whole payload. Apple不会更改您的JSON或干扰数据包,因此您可以控制整个有效负载。

Just remember, you do NOT need to null-terminate your JSON string. 请记住,您不需要对JSON字符串进行空终止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM