Skip to main content
CometChat provides 4 listeners viz.
  1. UserListener
  2. GroupListener
  3. MessageListener
  4. CallListener

User Listener

The UserListener class provides you with live events related to users. Below are the callback methods provided by the UserListener class. Use addUserListener() to register and removeUserListener() to unregister. Call remove in onPause().
Always remove listeners when they’re no longer needed (e.g., in onDestroy() or when navigating away). Failing to remove listeners can cause memory leaks and duplicate event handling.

Group Listener

The GroupListener class provides you with all the real-time events related to groups. Below are the callback methods provided by the GroupListener class. These callbacks use Action, User, and Group objects. Use addGroupListener() to register and removeGroupListener() to unregister. Call remove in onPause().

Message Listener

The MessageListener class provides you with live events related to messages. Below are the callback methods provided by the MessageListener class. Use addMessageListener() to register and removeMessageListener() to unregister. Call remove in onPause().

Call Listener

The CallListener class provides you with live events related to calls. Below are the callback methods provided by the CallListener class. Use addCallListener() to register and removeCallListener() to unregister. Call remove in onPause().

Next Steps

Receive Messages

Handle incoming messages with message listeners

User Presence

Track user online/offline status with user listeners

Ringing

Handle incoming calls with call listeners

Retrieve Groups

Monitor group events with group listeners