chat21-ionic icon indicating copy to clipboard operation
chat21-ionic copied to clipboard

How to show badge as new message in chat list ?

Open naitikpatel1990 opened this issue 6 years ago • 4 comments

Hi,

screen shot 2019-02-21 at 4 09 17 pm

Can you please tell me, how you handle new message badge icon show ?

is it handled by firebase itself or handled by your code ?

naitikpatel1990 avatar Feb 21 '19 10:02 naitikpatel1990

it's handled by our code. The conversation model has is_new field. It's true if there are new messages in the converversation.

andrealeo83 avatar Feb 21 '19 10:02 andrealeo83

Can you please send me chats Objects screenshot for let me know where it should be set 'is_new' ?

and also how you changed back when chat is open ? Do you write specific code?

naitikpatel1990 avatar Feb 21 '19 10:02 naitikpatel1990

PING!!!

naitikpatel1990 avatar Feb 27 '19 12:02 naitikpatel1990

The field is_new = true is set here (server side) : https://github.com/chat21/chat21-cloud-functions/blob/master/functions/chat-api.js

image

The clients (ios, android, ionic,etc..) when receive the message update the field to false

andrealeo83 avatar Feb 27 '19 14:02 andrealeo83