# Filter group channels by unread message does not work

**URL:** <https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928>\
**Category:** iOS\
**Tags:** group-channel, chatsdk\
**Created:** [September 10, 2020, 9:39am UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928 "2020-09-10T09:39:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flow](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/flow/32/489_2.png) [@Flow](https://community.sendbird.com/u/Flow)\
**Post date:** [September 10, 2020, 9:39am UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928/1 "2020-09-10T09:39:59Z")

</div>

Hello there,

Sorry if it’s not the right place, but I did not find any tool to file a bug (from Github or Documentation).

Whenever you want to query the group channels and filter them to get only the unread channels, it always returns **nil**. Here is the code sample:

```
let query = SBDGroupChannel.createMyGroupChannelListQuery()
query?.limit = 100
query?.unreadChannelFilter = SBDUnreadChannelFilter.unreadMessage
query?.loadNextPage(completionHandler: { channels, error in
    completion?(channels)
})

```

If I query the channels without any filter, I get them and their **unread** flag is set to **1**.  
It seems there is a bug on that previous API.

I am using the last version of the SDK for iOS (3.0.201)

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jason/32/488_2.png) [@Jason](https://community.sendbird.com/u/Jason)\
**Post date:** [September 13, 2020, 3:59am UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928/2 "2020-09-13T03:59:39Z")

</div>

Hi @Flow,

I was able to reproduce the issue that you outline here. I will file a bug report with our engineering team. While the bug is being fixed, I want to mention that by default channels are returned with unread message channel first ordered with chronologically based on when the last message was sent. However, this is no good if you only want to return channel with unread messages in them.

I will update you regarding the bug fix.

---

<div class="post-metadata">

**Author:** ![Flow](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/flow/32/489_2.png) [@Flow](https://community.sendbird.com/u/Flow)\
**Post date:** [September 14, 2020, 2:36pm UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928/3 "2020-09-14T14:36:34Z")

</div>

Great ! That’s good news. Thanks a lot for the support.

---

<div class="post-metadata">

**Author:** ![Logan\_Parker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/logan_parker/32/2999_2.png) [@Logan\_Parker](https://community.sendbird.com/u/Logan_Parker)\
**Post date:** [September 13, 2022, 9:00pm UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928/4 "2022-09-13T21:00:39Z")

</div>

I am also experiencing this problem on flutter. Any update on this?

---

<div class="post-metadata">

**Author:** ![Sven](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sven/32/1360_2.png) [@Sven](https://community.sendbird.com/u/Sven)\
**Post date:** [April 3, 2023, 9:34pm UTC](https://community.sendbird.com/t/filter-group-channels-by-unread-message-does-not-work/928/5 "2023-04-03T21:34:54Z")

</div>

I’d like to implement a switch in our UI so that I can view Read or Unread messages.

Calling:  
let query = SBDGroupChannel.createMyGroupChannelListQuery()  
query?.unreadChannelFilter = SBDUnreadChannelFilter.unreadMessage

Does not seem to work and we are using SendbirdChatSDK v4.6.2.

Seeing an issue was reported some time back. Can you please advise on the correct API to call and/or if there’s a workaround available?
