0
votes

From Apple specification, the maximum payload of push notification message is 256 bytes. Normally, the minimum payload should be {"aps":{"alert":""}} which have taken 20 bytes. So, the maximum number of bytes in message should be 236 bytes.

From Worklight perspective, what will be the minimum payload of the push notification message? As I am not sure whether it will append something like sound: null or the event source name to the payload or not. Ultimately I would like to derive number of bytes which can be sent through APNS in Worklight.

Thanks a lot.

1
I haven't done this yet myself, but you can start stripping the payload and see when it fails, that would be your minimum payload from Worklight's perspective. :) - Idan Adar
Yes, but unfortunately I do not have an Apple Developer account for the testing :( so would like to ask if anyone have experience on this ... - red23jordan

1 Answers

1
votes

When sending a simple push notification with a message only, the max length of your message is, deterministically, 236 characters.

Your payload is that JSON string, which must be 256 characters. Apple does not change your JSON or interfere with the packet, so you are in control of the whole payload.

Just remember, you do NOT need to null-terminate your JSON string.