getUnreadMessageCount( )

getUnreadMessageCount( ) API can be used to find out the total unread messages count of contacts and groups. By passing specific contact id or group id you can get total count of unread messages for specific id.

API:

jqcc.cometchat.getUnreadMessageCount({'contact':[],'group':[]});

For contact, groups you can pass single or multiple userid, groupdid. It will return the total count of unread messages.

Sample:

To get total unread message:

var totalunreadmessages = jqcc.cometchat.getUnreadMessageCount();

To get total unread message of userid 1,2,3

var userstotalunreadmessages = jqcc.cometchat.getUnreadMessageCount({'contact':[1,2,3]});

To get groups unread message of groupids 1,2,3

var groupstotalunreadmessages = jqcc.cometchat.getUnreadMessageCount({'group':[1,2,3]});

Not finding what you need?

The CometChat team is here to help!