Event handlers overview
The Nexconn Chat SDK delivers real-time events through handler interfaces. Each interface covers a specific domain. You register handlers via NCEngine with a unique identifier string, which lets you add multiple independent listeners for the same event type and remove them individually.
How it works
All handler interfaces follow the same pattern:
- Register — call the appropriate
NCEngine.addXxxHandler(identifier, handler)method before you need events. - Implement — implement only the callbacks you care about. All interface methods have default empty implementations.
- Remove — call
NCEngine.removeXxxHandler(identifier)when the handler is no longer needed.
kotlin
// Register
NCEngine.addGroupChannelHandler("MY_HANDLER", object : GroupChannelHandler {
override fun onGroupOperation(event: GroupOperationEventInfo) {
println("Group ${event.groupId} operation: ${event.operationType}")
}
})
// Remove
NCEngine.removeGroupChannelHandler("MY_HANDLER")
Most callbacks deliver an event object that carries all the relevant data. Read the details through its properties.
Available handler interfaces
| Interface | Register/Remove method prefix | What it covers |
|---|---|---|
GroupChannelHandler | addGroupChannelHandler | Group operations, profile changes, member changes, join requests, favorites sync |
OpenChannelHandler | addOpenChannelHandler | Open channel enter/exit lifecycle, metadata, members, mute/ban |
ChannelHandler | addChannelHandler | Channel list sync, pinned/DND/translate settings, typing status, community sub-channel events |
UserHandler | addUserHandler | Subscription events, friend add/delete/apply/clear |
UserSettingsHandler | addUserSettingsHandler | User-level settings sync completed |
MessageHandler | addMessageHandler | Message receive, delete, modify, read receipts, stream messages, metadata |
TagHandler | addTagHandler | Tag and channel-tag changes (multi-device sync) |
TranslateHandler | addTranslateHandler | Translation language changes and auto-translate state |
DatabaseStatusHandler | addDatabaseStatusHandler | Database schema upgrade lifecycle |
ConnectionStatusHandler | addConnectionStatusHandler | SDK connection status changes |