chat21 / chat21-ionic

A ionic v5 and Angular 8 desktop and mobile chat
https://tiledesk.com/
MIT License
83 stars 93 forks source link

How to show badge as new message in chat list ? #48

Open naitikpatel1990 opened 5 years ago

naitikpatel1990 commented 5 years ago

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 ?

andrealeo83 commented 5 years ago

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

naitikpatel1990 commented 5 years ago

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 commented 5 years ago

PING!!!

andrealeo83 commented 5 years ago

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