# Get unread message count from group channel

**URL:** <https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197>\
**Category:** Miscellaneous\
**Tags:** group-channel, push-notification, chatsdk\
**Created:** [March 16, 2022, 5:25am UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197 "2022-03-16T05:25:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prerna\_Kumari](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/prerna_kumari/32/2209_2.png) [@Prerna\_Kumari](https://community.sendbird.com/u/Prerna_Kumari)\
**Post date:** [March 16, 2022, 5:25am UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/1 "2022-03-16T05:25:43Z")

</div>

For the messages send from push notification the groupchannel getUnreadCount still giving value as 0. whereas if not send from push notification groupchannel getUnreadCount is giving the count properly.  
Please let me know does it reqiures any specific setting from dashboad or any thing else from code perspective.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 18, 2022, 4:48pm UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/3 "2022-03-18T16:48:43Z")

</div>

Hi @Prerna_Kumari,

Welcome to the Sendbird Community! I’d love to help you dig into this issue. Could you tell me how you’re grabbing the `getUnreadCount` on the push notification? Additionally, could you provide me with the SDK and SDK version you’re using?

---

<div class="post-metadata">

**Author:** ![Prerna\_Kumari](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/prerna_kumari/32/2209_2.png) [@Prerna\_Kumari](https://community.sendbird.com/u/Prerna_Kumari)\
**Post date:** [March 19, 2022, 6:26am UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/4 "2022-03-19T06:26:21Z")

</div>

Hi,  
Thanks for your response. From push Notification remote json message contain “channel\_unread\_message\_count” inside channel object which is giving me the correct count whereas if i try to get directly from Groupchannel.getUnreadMessageCount() its not count the unread message that comes from Notification.

for example:  
if I send one notification outside app, from remote json i will get “channel\_unread\_message\_count”:1 whereas if i try to fetch the same from Groupchannel.getUnreadMessageCount() returns 0;

SDK version:  
implementation ‘com.sendbird.sdk:sendbird-android-sdk:3.0.159’  
implementation ‘com.sendbird.sdk:sendbird-syncmanager:1.1.30’  
implementation ‘com.sendbird.sdk:sendbird-calls:1.5.3’

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 21, 2022, 4:29pm UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/5 "2022-03-21T16:29:03Z")

</div>

Hi @Prerna_Kumari,

My apologies for the delayed response. Let me take a look at this and see if I can reproduce the behavior.

---

<div class="post-metadata">

**Author:** ![Prerna\_Kumari](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/prerna_kumari/32/2209_2.png) [@Prerna\_Kumari](https://community.sendbird.com/u/Prerna_Kumari)\
**Post date:** [March 24, 2022, 12:13pm UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/6 "2022-03-24T12:13:18Z")

</div>

Hi @Tyler

Any update on the issue.

---

<div class="post-metadata">

**Author:** ![zdungx](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zdungx/32/4018_2.png) [@zdungx](https://community.sendbird.com/u/zdungx)\
**Post date:** [June 5, 2023, 6:46am UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/7 "2023-06-05T06:46:42Z")

</div>

Hi @Tyler and @Prerna_Kumari  
Any update for this issue.  
I have same problem.

Step reproduce:  
1/ App running in background mode  
2/ Received push notification in the background mode  
3/ Fetch the list channel in background and update on list channel ui.  
4/ Resume app to foreground mode.  
5/ =\> Unread message does not update, still return old value. I used this func `this.groupChannel.unreadMessageCount;`

Device: iOS / android  
Platform: React native  
Language: typescript  
Sendbird package: “sendbird”: “3.1.9”

---

<div class="post-metadata">

**Author:** ![LavishSwarnkar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/lavishswarnkar/32/4209_2.png) [@LavishSwarnkar](https://community.sendbird.com/u/LavishSwarnkar)\
**Post date:** [June 23, 2023, 10:47am UTC](https://community.sendbird.com/t/get-unread-message-count-from-group-channel/4197/8 "2023-06-23T10:47:47Z")

</div>

@Tyler I am also facing this issue. Push notifications are sent in real-time and `unread_message_count` is correct in its payload. But when getting `unreadMessageCount` from the `GroupChannel` object using SDK, it is unreliable. It rarely returns correct value. Most of the times, old value is returned. Also, the `ChannelHandler.onChannelUpdated()` is also not invoked when new message is received. It should be invoked because unreadMessageCount will be updated.

SDK : Android  
Versions used :  
com.sendbird.sdk:sendbird-chat:4.9.0  
com.sendbird.sdk:uikit:3.5.7
