问题
In apple push notification I am sending emojis in payload and they as showing as Unicode characters in notification.
Using ApnsPayloadBuilder
to create payload and sending message like
payloadBuilder.setAlertBody(new String(msg, "UTF-8"));
I am getting this message from our database and emojis are storing like
nice \u270c\ufe0f\ud83d\udc4d
in db.
How do I solve this issue?
回答1:
You need to send the unicode character in the payload, not as an emoji. So for the winking face in your payload, sent it as \ue405 not as 😉. You can use this website for finding the unicode translations for the emojis http://www.easyapns.com/category/just-for-fun
来源:https://stackoverflow.com/questions/37592817/ios-emojis-show-as-unicode-characters-in-push-notification-using-java