Emoji Support for iOS and Android

2019-05-02 11:07发布

问题:

I am trying to develop an application for both iOS and Android with emoji support in posts. Currently I am Base64 encoding and decoding the String (text &/ emoji) with UTF-8. It seems to work natively, Android-to-Android and iOS-to-iOS, but from Android -> iOS or iOS -> Android it doesn't always work. There are occasionally a few emojis missing, and the rest of the string (any actual text) is lost in these instances.

Note: I understand different devices have different emojis, so I am not as worried about occasional missing emojis, but the missing text bothers me, and I noticed a missing emoji on the same device.

Does anyone have any ideas or know of any better solutions? Thanks!

回答1:

I managed to figure it out. We are no longer encoding or decoding the string. Instead, I modified the TextView in Android to re-format the string so that both the text and the emojis display. I made a very simple library based on my solution. https://github.com/will5/EMOJITextView