Skip to main content
Track whether users are online or offline in real-time.

Real-time Presence

Configure presence subscription in AppSettings during SDK initialization. The AppSettingsBuilder provides three subscription options: If none of these methods are called, no presence events will be delivered.
You must configure presence subscription in AppSettings during CometChat.init() before any presence events will be delivered. See Setup SDK for details.

Presence Subscription

Subscribe to Friends Only

Subscribe to Specific Roles

CometChatUserDelegate

Register a CometChatUserDelegate to receive real-time presence events:
Always remove your delegate when the view is dismissed to prevent memory leaks and duplicate event handling.

User List Presence

When fetching users via UsersRequest, each User object includes presence fields:

Next Steps

Retrieve Users

Fetch user lists with filtering and pagination.

User Management

Create and update users programmatically.

Connection Status

Monitor SDK connection to CometChat servers.

All Real-time Listeners

Overview of all available real-time listeners.