Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending Emojis in Firebase notifications

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!

like image 784
sanch Avatar asked Mar 24 '18 02:03

sanch


1 Answers

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

like image 120
sam9046 Avatar answered Nov 13 '22 10:11

sam9046