Skip to content

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

@aparajita-sinha

Description

@aparajita-sinha

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()));
                   }
               });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions