Help with Notification Tray – totalUnreadCount is always zero for post creation

Hi,
We’ve enabled the notification tray feature for our application and are currently integrating it.
Authentication is working as expected—we’re retrieving a valid access token for User A1 and using it to call the API:
GET https://beta.amity.services/notifications/v3
However, the response always shows totalPages: 0 and totalUnreadCount: 0.
Scenario:

  1. User A2 creates a post in a shared community.
  2. User A1 then logs in and fetches the notifications.
    Result: totalUnreadCount is still 0.
  3. But if User A1 creates a post and User A2 comments on it,
    Then totalUnreadCount becomes 1.
    This suggests only notifications related to interactions on the user’s own content are counted, not general activity in the community.

Question:
What is the best practice to configure the notification tray so that:
A user (e.g., A1) receives notifications when others create posts, comment, or react within the same community?
We want to ensure users are notified of all relevant activity in their communities—not just interactions tied to their own content.

Specs:
Using “@amityco/ts-sdk”: “^6.30.4”, in angular application.
Sample Code:

    async getToken2(server_key: string, api_key: string, userName: string, displayName: string) {
        const response = await fetch('https://apix.us.amity.co/api/v3/authentication/token?userId=' + userName, {
            method: 'GET',
            headers: {
                'x-server-key': server_key,
                accept: 'application/json'
            }
        });
        
        const data = await response.json();
        if(data) {
            this.getSession(
                userName,
                displayName,
                data,
                api_key
            );
        }
    }

    async getSession(userId, displayName, token, api_key) {
        const response = await fetch('https://apix.us.amity.co/api/v3/sessions', {
            method: 'POST',
            headers: {
                'x-api-key': api_key,
                accept: 'application/json',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                userId: userId,
                deviceId: this.uuid,
                displayName: displayName, // optional
                authToken: token // only required if using secure mode
            })
        });
        
        const data = await response.json();
        if(data) {
            this.getNotificationCount(data.accessToken);
            this.getNotificationHistory(data.accessToken);
        }
    }

    async getNotificationCount(token) {
        const response = await fetch('https://beta.amity.services/notifications/v3', {
            method: 'GET',
            headers: {
            'Authorization': "Bearer " + token
            }
        });
        
        const data = await response.json();
        console.log(data);
    }

    async getNotificationHistory(token) {
        const startAfter = 1745256102357; // Mon Apr 21 2025 12:21:42 GMT-0500
        const url = `https://beta.amity.services/notifications/v3/history?startAfter=${encodeURIComponent(startAfter)}`;

        const response = await fetch(url, {
            method: 'GET',
            headers: {
                'Authorization': "Bearer " + token
            }
        });

        const data = await response.json();
        console.log(data);
    }

Thanks!

Hello @Sowmya , Thank you for providing the detailed explanation and sample code.

We’ve noted the behavior you’re experiencing and will pass this to our development team for further investigation. We’ll follow up with an update once we have more insights to share.

Appreciate your patience and thanks again for reaching out!

Just checking in to see if there have been any updates regarding the issue we discussed earlier. I’m happy to provide any additional information if needed.

1 Like

Hello @Sowmya , Thank you for checking in.

Our team is now able to reproduce the issue and is actively investigating to identify the root cause. I’ll make sure to keep you updated as soon as we have any findings.

Please feel free to share any further details that might assist in the investigation.

Hello @Sowmya , Regarding the issue you encountered, we would like to suggest using our new Notification Tray feature.
You can refer to the full documentation here:
:link: Notification tray | Social+ Docs

Please feel free to reach out if you have any further questions. We’re happy to help!