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.
Fix Notification.trim() for alerts with multibyte chars.