Channel overview
A channel is the fundamental unit of messaging in the Nexconn SDK. The SDK automatically creates and maintains channel relationships based on each message's sender, recipient, and channel type.
Channel types
Nexconn SDK supports several channel types for different use cases. Each type is represented by a ChannelType enum value:
| Enum Value | Channel Type | Description |
|---|---|---|
ChannelType.DIRECT | Direct channel | One-to-one private chat between two users |
ChannelType.GROUP | Group channel | Multi-user group chat |
ChannelType.SYSTEM | System channel | System notifications, announcements, etc. |
ChannelType.OPEN | Open channel | Public channel similar to a chat room |
ChannelType.COMMUNITY | Community channel | Community-style channel with subchannels |
Direct channel
A direct channel enables one-to-one messaging between two users. The two users may or may not be contacts — Nexconn does not manage user relationships. The SDK automatically establishes and maintains the channel relationship.
Persistent messages in a direct channel are saved to the local database on the client.
Group channel
A group channel allows two or more users to chat together. Your app provides and manages group membership; Nexconn is responsible only for delivering messages to all group members. Each group supports up to 3,000 members, and there is no limit on the number of groups in your app.
Persistent messages in a group channel are saved to the local database on the client.
Community channel
A community channel is a large-scale multi-user chat service with no upper limit on membership. It supports high-concurrency real-time messaging and push notifications. Your app provides and manages member information, while Nexconn delivers messages to members. There is no limit on the number of community channels in your app. A single user can join up to 100 community channels.
Messages in a community channel are saved to the local database on the client. For more details, see Community Channel Overview.
Open channel
An open channel has no upper limit on participants and supports high-concurrency real-time messaging. After a user leaves an open channel, they no longer receive any messages from that channel, and push notifications are not available. The SDK manages the channel connection. Users can join or leave open channels through the SDK's APIs.
The SDK does not persist open channel messages. All data for the channel is cleared when the user exits. For more details, see Open Channel Overview.
System channel
A system channel is created when a system account sends messages to users — for example, broadcast messages sent via the broadcast API, or individual notification messages such as friend request notifications.
Channel model
The Nexconn SDK uses a rich channel model. Each channel type has a dedicated class, and all channel classes extend BaseChannel:
BaseChannel
├── DirectChannel
├── GroupChannel
├── SystemChannel
├── OpenChannel
└── CommunityChannel
Create a channel instance
- Kotlin
- Java
val directChannel = DirectChannel("userId")
val groupChannel = GroupChannel("groupId")
val systemChannel = SystemChannel("systemId")
val openChannel = OpenChannel("openChannelId")
val communityChannel = CommunityChannel("communityId")
DirectChannel directChannel = new DirectChannel("userId");
GroupChannel groupChannel = new GroupChannel("groupId");
SystemChannel systemChannel = new SystemChannel("systemId");
OpenChannel openChannel = new OpenChannel("openChannelId");
CommunityChannel communityChannel = new CommunityChannel("communityId");
Channel properties
The following table lists the key properties available on BaseChannel:
| Property | Type | Description |
|---|---|---|
channelId | String | Unique identifier for the channel.
|
channelType | ChannelType | The type of channel. See descriptions above. |
unreadCount | Int | Number of unread messages in the channel. |
isPinned | Boolean | Whether the channel is pinned. |
latestMessage | Message? | The last message stored locally on the client. For message storage behavior, see the MessageTag section in Message Introduction. |
draft | String? | Draft text saved in the channel. See Draft Details. |
operationTime | Long | Channel operation timestamp (Unix timestamp in milliseconds), used as the cursor for paginated channel list queries. Initially equals sentTime; updated by operations such as pinning. |
mentionedCount | Int | Number of messages in the channel that mention the current user (including @all). |
mentionedMeCount | Int | Number of unread messages that mention only the current user. |
channelNoDisturbLevel | ChannelNoDisturbLevel | Push notification level for the channel. See Do Not Disturb Overview. |
translateStrategy | TranslateStrategy | Translation strategy for the channel. See Smart Text Translation. |
includeRobot | Boolean | Whether the channel includes a bot. |
editedMessageDraft | EditedMessageDraft? | Draft content saved while editing a previously sent message. |