emoji in pub/sub messaging

I am trying to add a chat feature in my app using the iOS api, but I encounter the following problem.

When I send a message that contains emoji I receive the message but the emoji is displayed as question marks instead of the actual emoji. Regular text work fine.
Can you please explain to me how I can resolve this issue?

Thank you in advance.

Regards,

George

Hi George,

We’ll investigate your issue as soon as possible.
Regards Ilya

The internal task BKNDLSS-12698 is created. We will let you know about a result.

Any updates to this?
I’m also facing this exact issue and the app could not be launched until this is resolved.

Regards,
Melvin

Hi Melvin,
The task is still in progress. We shall notify as soon as it is resolved.

Hi All,
a temp solution and workaround for now is this

When you send out the message take your String message and apply the following

stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.alphanumericCharacterSet())

When you receive the message on the other end, apply the following

stringByRemovingPercentEncoding

Regards,

George

Hi George,

When I encode the message to be sent out to Backendless Push Notification, all the emojis are being displayed with the percent encodings on the recipient’s notifications.

There’s no way the message can be intercepted to remove the percent encoding when it arrives at the user’s phone.

Am I missing anything else?

Regards,
Melvin

George, thank you for your advice. It is really fine temporary solution.
This task is in progress yet, but it has a low level (this is free support).

Hi Melvin,

No you are not missing anything, I just did not realize you where sending emoji in your Push Notifications. The way I described works only when you publish a message by publish/subscribe methods (like a chat), not by sending push notifications.

You are correct in that there is no way to intercept the notification before presenting it. Maybe try and encode the message before you send is as UTF-8 String and see if that works?

I am pretty sure there is an encoding/decoding issue like the one I have but not really sure how to resolve it in your situation.

Regards,

George

Hi George,

Thanks for the reply. I’ve tried a few encoding methods and doesn’t seem to work. In the meantime, I’ve instead stripped out all emojis in the notifications as a temporary solution.

Do let me know when there is a new resolution to this :slight_smile:

Regards,
Melvin

Hi Slava,

I saw on GitHub, that the new version 3.0.43 has an added feature that supports emoji.
How do we use this new feature? Is there a special method that is added, or the work is done on the server side, and we get the result back with emoji shown correctly?

Thank you in advance.

Regards,

George

It was a bug fix that allows emojis to be sent/received. The fix currently applies only to using emojis in data objects. There is another fix for emojis in pub/sub. It depends on updating the server with a hotfix, which is planned for next week.

Regards,
Mark