chat-sdk / chat-sdk-android

Chat SDK Android - Open Source Mobile Messenger

Home Page:https://chatsdk.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any method to find out number of all unread messages?

anonym24 opened this issue · comments

Demo has counter of unread messages on each thread item view on threads list screen.

But I need to get the number of all unread messages - one number - one int variable. Is it possible?

Would be good if this value would be updated automatically - rx observer - firebase realtime datebase value event listener

I need to show it like this for example (whole number - all unread messages count):

image

You would need to loop over the threads for the current user:

int count = 0;
for (Thread t :  ChatSDK.thread().getThreads(ThreadType.Private1to1)) {
    count += t.getUnreadMessagesCount();
}

There is no syncing with the firebase realtime database for "read" status mark in free SDK, this is just maintaining the read unread mark in the local database so when we uninstall the app database will be cleared and then install the app all thread messages becomes show as a new unread message.

So the read unread status feature is paid service or it's free? please make me clear.