Skip to content

add support for getUnreadCount API #2298

@MichaelMarner

Description

@MichaelMarner

Please select which package this feature is related to

stream_chat

Which platforms would this feature impact?

iOS, Android, Web, Windows, MacOS, Linux

Is your feature request related to a problem?

Other Stream SDKs, such as the javascript sdk allow querying the unread count, and getting more detail about unread channels, channel types, etc.

https://getstream.io/chat/docs/javascript/unread/#fetch-unread-api

This functionality is currently not implemented in the Dart/Flutter SDK. However, as this API can be called client side as a regular user, there is no reason why it should not be added to the SDK.

Describe the solution that you'd like

A new method added to StreamChatClient for fetching the unread counts.

Something like:

const unreads = await streamChatClient.getUnreadCount();

print(unreads.channelType['team']) // prints the number of unread for the team channel type

Describe alternatives that you have considered

No response

Additional context

This is very useful to us as we are using Stream for two separate features in our app and need to be able to show separate unread counts in different parts of the UI

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpr_openA PR to fix the issue is already open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions