Skip to main content

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 ValueChannel TypeDescription
ChannelType.DIRECTDirect channelOne-to-one private chat between two users
ChannelType.GROUPGroup channelMulti-user group chat
ChannelType.SYSTEMSystem channelSystem notifications, announcements, etc.
ChannelType.OPENOpen channelPublic channel similar to a chat room
ChannelType.COMMUNITYCommunity channelCommunity-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
val directChannel = DirectChannel("userId")

val groupChannel = GroupChannel("groupId")

val systemChannel = SystemChannel("systemId")

val openChannel = OpenChannel("openChannelId")

val communityChannel = CommunityChannel("communityId")

Channel properties

The following table lists the key properties available on BaseChannel:

PropertyTypeDescription
channelIdStringUnique identifier for the channel.
  • In a direct channel, this is the other user's ID.
  • In group, open, and community channels, this is the corresponding channel ID.
  • In a system channel, this is the system account ID specified by the developer.
channelTypeChannelTypeThe type of channel. See descriptions above.
unreadCountIntNumber of unread messages in the channel.
isPinnedBooleanWhether the channel is pinned.
latestMessageMessage?The last message stored locally on the client. For message storage behavior, see the MessageTag section in Message Introduction.
draftString?Draft text saved in the channel. See Draft Details.
operationTimeLongChannel operation timestamp (Unix timestamp in milliseconds), used as the cursor for paginated channel list queries. Initially equals sentTime; updated by operations such as pinning.
mentionedCountIntNumber of messages in the channel that mention the current user (including @all).
mentionedMeCountIntNumber of unread messages that mention only the current user.
channelNoDisturbLevelChannelNoDisturbLevelPush notification level for the channel. See Do Not Disturb Overview.
translateStrategyTranslateStrategyTranslation strategy for the channel. See Smart Text Translation.
includeRobotBooleanWhether the channel includes a bot.
editedMessageDraftEditedMessageDraft?Draft content saved while editing a previously sent message.