Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

256 bytes limitation #33

Open
n-studio opened this issue Oct 9, 2014 · 2 comments
Open

256 bytes limitation #33

n-studio opened this issue Oct 9, 2014 · 2 comments

Comments

@n-studio
Copy link

n-studio commented Oct 9, 2014

Hi all,
I spent hours of debugging to find out that the notification didn't work because of the 256 bytes limitation.
It would be nice to raise an error when the payload exceeds 256 bytes.

Would a raise "Error" if message.to_json.size > 256 work in Notification.initialize(device_token, message) ?

@mkonecny
Copy link

iOS8 now supports 2KB of data per push message, so this is not as simple as it appears.

If possible, you should be using push to notify the client to fetch new data, not send the data in the push message itself. Hopefully this way you will never hit the 256 (or 2048 byte) limitation.

@n-studio
Copy link
Author

Oh, I didn't know for iOS8 new limitation.
I need to display a preview of the message in the notification panel so even if the app fetched the message afterwards a part of the message must be sent. As the other info (user ID, message id) have variable lengths, I think it's useful to get an access to the payload size in bytes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants