Hi,

I get an "Invalid Payload" error on some push notifications I send to iOS devices. If I send the exact same message to several devices (both iOS and Android) it is always the same two that fail and the others work.

Does anyone know what might be wrong?

Thanks!

//Björn

asked 09 Jul '14, 07:22
Colliander's gravatar image

Colliander
11

Hello, can you provide pushwoosh username & message id?

(09 Jul '14, 07:25) XXXX XXXX's gravatar image

Yes, Bosbec and id: 696329185 and 696327828

(09 Jul '14, 07:40) Colliander Colliander's gravatar image

Hello,

The "Invalid Payload Size" error indicates that the notification that you have sent is to big. Please note that there are limitations on push notification size both from APNs and GCM (256 and 4096 bytes respectively). Apple simply does not accept the notification for delivery in case it extends the limitation.

In order to avoid this inconvenience, you can add the "apns_trim_content":1 line in the createMessage request. This way, your notification would be delivered, although the message itself would be shortened.

permanent link
answered 09 Jul '14, 07:28
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

Hi, yes but why does it get delivered to some iOS devices and not others?

(09 Jul '14, 07:42) Colliander Colliander's gravatar image

Could you please let us know your Pushwoosh username and the messageID of any notification that wasn't delivered to some of your users? We will investigate the issue more closely.

(09 Jul '14, 08:02) Dmitry Dyudeev Dmitry%20%20Dyudeev's gravatar image

Yes, I've posted it earlier, please look at these: Bosbec and id: 696329185 and 696327828

I think it is something with the truncate function that has changed since it has worked before. I tried sending a long message to myself and on android it was delivered but on iOS I got the payload error. I can see that the message has been truncated but perhaps not as much as it needed?

Do you know if the restrictions has changed?

(09 Jul '14, 08:19) Colliander Colliander's gravatar image

I apologize, haven't noticed the upper comments. Actually, it seems that there is some kind of a misprint in the createMessage request that you are sending: as you can see in details of these pushes, "apns_trim_content" wasn't enabled. Please also note that the limitation from APNs is much more strict that the GCM's one, that is why your test message was successfully delivered to Android device. Could you show us the whole createMessage request you are sending?

(09 Jul '14, 08:30) Dmitry Dyudeev Dmitry%20%20Dyudeev's gravatar image

I checked our service and we are currently truncating messages at 180 characters

(09 Jul '14, 08:33) Colliander Colliander's gravatar image

Please note that aside from the message itself, payload includes some other parameters - for instance, the custom data, which is quite large on some of your pushes. Most probably, this is the source of the issue.

(09 Jul '14, 08:57) Dmitry Dyudeev Dmitry%20%20Dyudeev's gravatar image
showing 5 of 6 show 1 more comments
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:

×444
×352
×8
×6

question asked: 09 Jul '14, 07:22

question was seen: 1,641 times

last updated: 09 Jul '14, 08:57