Sending Emojis in Firebase notifications

sanch picture sanch · Mar 24, 2018 · Viewed 11.5k times · Source

Sort of a two part question here:

  1. How do I send emoji's through Firebase notifications? I tried entering a message of the thumbs up emoji with the message body being "\U1F44D" but that didn't render on my phone when the notification came through.

  2. How would I format a notification payload in my node.js file? I imagine it is the same as entering the specific unicode character that corresponds but I can't seem to get either to work... Either I am missing some magic or am not using the right codes.

Thanks!

Answer

sam9046 picture sam9046 · Aug 6, 2018

Putting this here to help someone else in future.

In answer to part 1 of your question, you can definitely send emoji's through Firebase notifications, emoji's are just unicode characters. For part 2, again it's just unicode so you should be able put the unicode char in your payload.

I usually use this page to look up the emoji http://www.unicode.org/emoji/charts/full-emoji-list.html and then just copy and paste the emoji itself into Firebase notifications and send. Firebase will show the emoji in its console.

Firebase notification message body