0

I am using FireBase for chat application. I need to add smileys and emoticons in my chat application.Is it possible to do it with Firebase object.

Please help me to find this solution.

Kichu
  • 1,641
  • 4
  • 21
  • 28

2 Answers2

0

It's possible to store image like explained in this post : How to store and view images on firebase?

But personnaly, in your case, I would choose rather to store a simple string like :wink: and parse it on the client side to replace it with the correct image...

Community
  • 1
  • 1
0

Emoticons are actually unicode characters and can be stored by their actual value. So for example a smile face is 1F642.

There's a wiki on that topic and I think it has a chart and cross reference on it.

Edit for completeness, some quick MacOS example code, but the concept applies to lots of different code bases.

Read a character from firebase, say 1F642, which is a smiley and then stuff it into a string that will allow it to be a unicode char. Then, assign that string to a text field that supports unicode; NSTextField in this case.

NSString *smiley = @"\U0001F642";
self.myTextField.stringValue = smiley;
Jay
  • 34,438
  • 18
  • 52
  • 81
  • Can you please share any document related to this? – Kichu Jan 14 '16 at 05:19
  • Links often break so search for Emoticons (Unicode_block) – Jay Jan 14 '16 at 13:33
  • In Firebase how can we make its as emoticons? – Kichu Jan 15 '16 at 04:29
  • You won't use firebase to store the actual emoticon. You will store it's hexadecimal equivalent so when you read it in, your app/OS will 'convert' it to a unicode character for display. I updated my answer with a code snippet and more info. – Jay Jan 15 '16 at 19:59