Every now and then I receive a "payload error" when I send out a push notification. Why is this and how do I avoid it?

http://cl.ly/image/0g1N0K053M00

asked 07 Mar '14, 17:42
Adam%20Soffer's gravatar image

Adam Soffer
465

edited 10 Mar '14, 11:18

Alex%20Spotar's gravatar image

Alex Spotar
3.6k6

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.

permanent link
answered 10 Mar '14, 11:16
Alex%20Spotar's gravatar image

Alex Spotar
3.6k6

edited 10 Mar '14, 11:16

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

(10 Mar '14, 19:12) Adam Soffer Adam%20Soffer's gravatar image

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?

(11 Mar '14, 09:25) Alex Spotar Alex%20Spotar's gravatar image

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/

(02 Sep '14, 09:19) fcjurado fcjurado's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×141
×16
×8

question asked: 07 Mar '14, 17:42

question was seen: 2,480 times

last updated: 02 Sep '14, 09:19