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.



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


To get total unread message count:

var totalunreadmessages = jqcc.cometchat.getUnreadMessageCount();

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

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

To get groups unread message count 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!