Fix for Notification.trim() and multibyte chars. #86

wants to merge 1 commit into


None yet

2 participants

mmaelzer commented Mar 8, 2013

I noticed that after calling .trim() on a notification, I'd occasionally still see an 'invalidPayloadSize' error. After digging into the node-apn source a bit, I noticed that this was caused by assuming single byte chars in a string when trimming. For example, it would fail to trim enough hindi chars in an alert since it was using .substring() with a byte length. I added a small method to the Notification class to remove chars until the string actually meets the desired byte size.

@argon argon closed this Mar 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment