4

https://stackoverflow.com/a/45890852/8413869

from the above answer, I got to know that emojis can be passed in Button formatted text.

But I am looking for emojis like google have it in Bubble response. enter image description here

I tried to pass unicode in simple response but no luck.

....."data": {
        "google": {
            "expectUserResponse": true,
            "richResponse": {
                "items": [
                    {
                        "simpleResponse": {
                            "ssml": "<speak>Hello. How are you ? </speak>",
                            "displayText": "Hello U+1F600., how are you ? "
                        }
                    }
                ],
                "suggestions": [],
                "linkOutSuggestion": {}
            }
        }
    }.....

Is there any way to do this ?

Sukh
  • 670
  • 5
  • 12

2 Answers2

5

I made it work with this uni code " \uD83D\uDE00" I just copied emoji from https://emojipedia.org/ which gave me this unicode

Sukh
  • 670
  • 5
  • 12
4

You can include emoji in simple responses for Google Assistant apps by including the actual emoji in the string instead of the Unicode code point for the emoji. Change your response to the below and it should work:

....."data": {
        "google": {
            "expectUserResponse": true,
            "richResponse": {
                "items": [
                    {
                        "simpleResponse": {
                            "ssml": "<speak>Hello. How are you ? </speak>",
                            "displayText": "Hello ., how are you ? "
                        }
                    }
                ],
                "suggestions": [],
                "linkOutSuggestion": {}
            }
        }
    }.....
mattcarrollcode
  • 3,429
  • 16
  • 16
  • thanks for replying, but I am using java webhook and preparing string. I don't think I can copy and paste this emoji in string. – Sukh Aug 29 '17 at 19:32
  • Here is a StackOverlflow question on how to include emoji in Java strings: https://stackoverflow.com/questions/26231263/create-string-with-emoji-unicode-flag-countries – mattcarrollcode Aug 29 '17 at 21:34
  • thanks, I made it work with this uni code " \uD83D\uDE00" I just copied emoji from https://emojipedia.org/ which gave me this unicode – Sukh Aug 30 '17 at 18:10