KustomerCore.getUnreadCount()

Get the unread counts for all conversations

πŸ‘

First, initialize chat

You must initialize with KustomerCore.init() before you can execute any additional Core SDK methods

πŸ“˜

Accurate after refresh

After you call KustomerCore.sendMessage(), you should also call KustomerCore.markRead() to make sure this KustomerCore.getUnreadCount() returns the correct data after a refresh.

Examples

// get unread counts
const unreadCounts = KustomerCore.getUnreadCount();

Syntax

returnValue = KustomerCore.getUnreadCount();
ParameterTypeDescription
returnValueObjectRequired

An object containing the unread counts. See below for the structure of returnValue.

returnValue

// returnValue

{
  total: Number,
  conversations: {
    SOME_CONVERSATION_ID: Number,
    OTHER_CONVERSATION_ID: Number,
    ANOTHER_CONVERSATION_ID: Number,
  }
}