How do I send messages with emoji and different languages using remote API?

Comments

3 comments

  • Avatar
    Dmitry Dyudeev

    Hello,

    You can pass a JSON object in the "content" section of our createMessage request in order to send a multi-language notification. As for the emoji, you can simply add them in the content as well, it would work.

    Here's an example with emoji and different languages:

    {
        "request": {
            "application": "AppID",
            "auth": "API access token",
            "notifications": [{
                "send_date": "now",
                "ignore_user_timezone": true,
                "content": {
                    "fr": "Le roi (♔, ♚)",
                    "en": "The king (♔, ♚)"
                }
            }]
        }
    }
    
  • Avatar
    BlueChatBox

    Thanks, your example worked and the emoji did in fact showed up on the iOS device properly.

    Now, if I were not able to copy and paste the emoji ♚ manually since the messages are being created and sent from a server automatically, how would the ♚ be represented text-wise in the request object?

  • Avatar
    BlueChatBox

    Found an example, this request will send the alien emoji (represented by unicode)

    { "request": { "application": "AppID", "auth": "API access token", "notifications": [{ "send_date": "now", "ignore_user_timezone": true, "content":"\uD83D\uDC7D" }] } }

Please sign in to leave a comment.