# Sendbird Firebase push data question

**URL:** <https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957>\
**Category:** Miscellaneous\
**Created:** [August 23, 2021, 2:24am UTC](https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957 "2021-08-23T02:24:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwony](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kwony](https://community.sendbird.com/u/kwony)\
**Post date:** [August 23, 2021, 2:24am UTC](https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957/1 "2021-08-23T02:24:18Z")

</div>

Hi

According to the article [Push notifications | Chat Android SDK | Sendbird Docs](https://sendbird.com/docs/chat/v3/android/guides/push-notifications#2-push-notifications-for-fcm-3-step-5-handle-an-fcm-message-payload), Sendbird sends push data when chat message is received via firebase when application is in background.

```auto
{
    "category": "messaging:offline_notification",
    ...
    "app_id": string, // Application's unique ID
    "unread_message_count": int, // Total number of new messages unread by the user
    "channel": {

```

Property `unread_message_count` shows the number of total unread message counts on all channels where user is joining. However we want to get unread message count filtered out by channels custom types.

| Channel name | Custom type | Unread messages |
| --- | --- | --- |
| google | America | 30 |
| apple | America | 20 |
| samsung | Korea | 30 |

In this case, I want to get unread message count filtered out by channel custom type ‘America’. I want to receive 50 instead of 80. Is it possible?

Best.  
kwony

---

<div class="post-metadata">

**Author:** ![ScottKim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottkim/32/3330_2.png) [@ScottKim](https://community.sendbird.com/u/ScottKim)\
**Post date:** [August 26, 2021, 8:45am UTC](https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957/2 "2021-08-26T08:45:00Z")

</div>

Hello,

Unread message counts are not provided grouped by custom type.

The channel’s unread\_message\_count represents the number of unread messages for the channel.

The total number of messages for each t type you want is a statistic.

Channels Custom types have many customers who are divided into hundreds or thousands of channels, and it is impossible to provide statistically all of these data at once.

A possible way would be to list the channels of the desired custom type and then sum them.

---

<div class="post-metadata">

**Author:** ![kwony](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kwony](https://community.sendbird.com/u/kwony)\
**Post date:** [August 31, 2021, 1:18am UTC](https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957/3 "2021-08-31T01:18:31Z")

</div>

Hello Scott Kim

I’m not sure you understood my request. I just want to `unread_message_count` in Firebase push data to deliver some specific channels (filtered out by custom type) unread message count not total channel’s one.

I found Sendbird already provides the number of unread message count filtered out by channel custom type on below. So I think Sendbird can apply same logic to Firebase Push Data too

```auto
    public static void getTotalUnreadMessageCount(List<String> channelCustomTypes, GroupChannelTotalUnreadMessageCountHandler handler) {
        localGetTotalUnreadMessageCount((SuperChannelFilter)null, channelCustomTypes, handler);
    }

```

---

<div class="post-metadata">

**Author:** ![ScottKim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottkim/32/3330_2.png) [@ScottKim](https://community.sendbird.com/u/ScottKim)\
**Post date:** [August 31, 2021, 7:03am UTC](https://community.sendbird.com/t/sendbird-firebase-push-data-question/2957/4 "2021-08-31T07:03:27Z")

</div>

Hi,  
Yes, you can get UnreadMessageCount of channel custom types through SDK.  
Not supported with Sendbird sends push data.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/e/e24fb3780e2270e125eee9ecc0ba4d2fff99a0f1.png)
