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
Sending unified emoji via apn #15
Comments
It looks like the issue is using utf8 encoding on the payload doesn't handle the extended unicode characters (or doesn't play well with APNS). Changing the encoding to usc2 fixes the issue, but I'm not sure if it breaks anything else at this point. Will let you know. |
Oh that's absolutely the case, I'm pretty sure that emoji falls under UTF-16. Let me know how the encoding change goes, I'll investigate unicode support in javascript/node and see what I can find out. Unicode is crazy. |
The change is very simple and shouldn't break anything since UCS2 is the predecessor to UTF-16. The disadvantage is it halves the number of characters you can fit in the 256 byte payload. So, probably makes sense to give people the option. The change is in sendNotification: var messageLength = Buffer.byteLength(message, encodingMethod); where encodingMethod is 'ucs2' or 'utf8' - default is utf8 for these functions. |
I will add an option for this and update the readme soon. I think I will add this on a per message basis, I am going to refrain from making it a global setting because of the detrimental nature of halving the message length. Thanks for figuring this out. |
Could you please share java code for sending Advance Emoji or images? |
This library is for JavaScript, not Java. Please checkout https://github.com/notnoop/java-apns for a Java version. ―A
|
Add typings for the "voip" NotificationPushType
Hello again Argon,
Thanks for your work on the reliability issue with bobrik. Another issue came up... I'm not sure if it's an issue on the node-apn side or on the Apple gateway side. Basically, alerts with the emoji unified standard unicode are dropped. Everything on the node side seems to work normally, but the message never arrives on the phone. If I use the old emoji softbank unicode char, for example '\ue415' for a smiley face, it works fine. If I use the new unified unicode standard, which the iPhone emoji keyboard outputs, for example '\uD83D\uDE04', it fails. Given your knowledge of apn on the node side and apple side, perhaps you might have some insight. It's possible that Apple's APN service hasn't caught up with the unified standard or doesn't accept the extended character set. Thank you for any help!
Dave
The text was updated successfully, but these errors were encountered: