Comments

5 comments

  • Avatar
    Alexander Spotar

    There's a push payload size limit of 256 bytes imposed by APNs. The "invalid payload" error indicates that the payload of your notification exceeds this limit. The minimum amount of additional content of the push request to APNs apart from the push text and custom data is:

    {"aps":{"alert":"1"},"p":"HASH"},
    

    There is also the "u" parameter which is used for defining your custom data. Therefore, in order to avoid "Invalid Payload Size" error we recommend using the following parameter for createMessage API request:

    "ios_trim_content": 1, // Optional. (0|1) Trims the exceeding content strings with elision marks
    

    It is applicable for iOS, Mac OS X and Safari pushes. We recommend using 205 bytes in total for your push notifications so they fit in the limit.

  • Avatar
    Adam Soffer

    I'm not going over the byte size limit (there's a counter in the pushwoosh textarea) and I still get a payload error every now and then. Could there be another cause?

    http://cl.ly/image/1w2p450S453r

  • Avatar
    Alexander Spotar

    Can you provide a screenshot of the "Summary" section (in the bottom of the Send Push page) after you fill all the inputs you need?

  • Avatar
    Francisco

    From API documentation, I can see "ios_trim_content" is deprecated. Maybe it would be the cause:

    "apns_trim_content":1,     // Optional. (0|1) Trims the exceeding content strings with ellipsis
    "ios_trim_content": 1,       // Depricated, use "apns_trim_content" instead.
    

    https://www.pushwoosh.com/programming-push-notification/pushwoosh-push-notification-remote-api/

Please sign in to leave a comment.