New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total payload size exceeds allowed limit #2
Comments
Ok, I saw the problem. It looks like complex() and other constructors have not been overridden and still uses PushNotificationPayload. |
Thanks @jayeatworld, I will look into this over the weekend. |
@jayeatworld Now it is fixed. |
Hi great news you got the fix in for payload size. Is there a .jar anywhere with the fix in? I tried getting in the latest from the Maven repo (v 2.3.1) and it still reports a max file size of 256 bytes. But it also says it was added in October 2015, (looks like before your fix)... |
Hi @voneddy, can you please post the code that you are using to send the notification? |
Hi Fernando Code used to send notification is: To android - MulticastResult result = sender.send(message, devicesList, 1); |
Please use PushNotificationBigPayload instead of PushNotificationPayload to build the payload. |
I thought this fork version of javapns would allow 2KB payloads? Is there a new way of sending push so it'll bypass the payload size?
I'm sending via:
PushNotificationPayload payload = PushNotificationPayload payload = PushNotificationBigPayload.complex();
payload.addAlert("...");
payload.addCustomDictionary("mydata", hugedata.toString());
Push.payload(payload, keystore, password, isProduction, threads, devices);
javapns.notification.exceptions.PayloadMaxSizeExceededException: Total payload size exceeds allowed limit (payload is 523 bytes, limit is 256)
at javapns.notification.Payload.validateMaximumPayloadSize(Payload.java:252)
at javapns.notification.Payload.getPayloadAsBytes(Payload.java:140)
at javapns.notification.PushNotificationManager.getMessage(PushNotificationManager.java:558)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:381)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
at javapns.notification.transmission.NotificationThread.runList(NotificationThread.java:228)
at javapns.notification.transmission.NotificationThread.run(NotificationThread.java:199)
at java.lang.Thread.run(Thread.java:745)
The text was updated successfully, but these errors were encountered: