Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to update the new messages count whenever a new message in received in ThreadType.PublicGroup #18

Open
aparajita-sinha opened this issue Sep 28, 2020 · 0 comments

Comments

@aparajita-sinha
Copy link

aparajita-sinha commented Sep 28, 2020

I have added this code in onCreate() but the listener is not fired. Can you please help?
I am using ChatSDK Android 4.8.18.
This listener is only called once when I enter the activity.

Disposable d = ChatSDK.events().sourceOnMain()
               .filter(NetworkEvent.filterType(EventType.MessageAdded))
               .filter(NetworkEvent.filterThreadEntityID(thread.getName()))
               .subscribe(new Consumer<NetworkEvent>() {
                   @Override
                   public void accept(NetworkEvent networkEvent) throws Exception {
                       txtBadgeCount.setText(String.valueOf(thread.getUnreadMessagesCount()));
                   }
               });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant