iOs emojis show as Unicode characters in push notification using java

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:06:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!