Channel overview
A channel is a logical relationship that the Nexconn SDK automatically creates and maintains based on the sender, recipient, and channel type of each message. It is an abstract concept.
Channel types
Nexconn supports multiple channel types to meet different business scenarios. The client SDK uses the NCChannelType enum to represent each type. The values and their meanings are listed below:
| Enum value | Channel type |
|---|---|
| NCChannelTypeDirect | Direct Channel |
| NCChannelTypeGroup | Group channel |
| NCChannelTypeCommunity | Community channel |
| NCChannelTypeOpen | Open channel |
| NCChannelTypeSystem | System channel |
Direct channel
A Direct Channel is a one-to-one chat between two users. The two users may or may not be friends — Nexconn does not manage user relationships. Nexconn is responsible for creating and maintaining the channel relationship.
Messages in a Direct Channel are stored in the local database on the client.
Group channel
A Group channel is a group chat with two or more users. The app provides and manages channel member information; Nexconn is responsible for delivering messages to all members. Each group supports up to 3,000 members, and there is no limit on the number of groups per app.
Messages in a Group channel are stored in the local database on the client.
Community channel
A Community channel is a multi-user chat service with no member limit. It supports high-concurrency, real-time message delivery and push notifications. The app provides and manages member information; Nexconn is responsible for delivering messages to all members. There is no limit on the number of Community channels per app, no member cap per Community channel, and a single user can join up to 100 Community channels.
Messages in a Community channel are stored in the local database on the client. For more information, see Community Channel Overview.
Open channel
An Open channel has no member limit and supports high-concurrency, real-time message delivery. Users stop receiving messages as soon as they leave the Open channel, and there are no push notifications. Nexconn creates and maintains the channel connection. Use the SDK's APIs to let users join or leave an Open channel.
The SDK does not persist Open channel messages and clears all data for the channel when the user leaves. For more information, see Open Channel Overview.
System channel
A system channel is created when a system account sends messages to a user. This type of channel can be established either by sending a broadcast message through the broadcast API or by single notification messages such as friend-request alerts.
Channel entity class
The channel entity class in the client SDK is NCBaseChannel. All channel-related information is accessed through this class.
The table below lists the main properties of NCBaseChannel.
| Property | Type | Description |
|---|---|---|
channelType | NCChannelType | Channel type (direct, group, open, community, etc.). |
channelId | NSString * | Channel ID. In a direct channel, this is the peer user's ID; in group/open/community channels, this is the group or channel ID. |
unreadCount | NSInteger | Number of unread messages in the channel. |
operationTime | int64_t | Channel operation time (Unix timestamp, milliseconds). Used as the pagination cursor when fetching the channel list. Updated by operations such as pinning. |
latestMessage | NCMessage * | Latest message in the channel (full message object). See Message Overview. |
draft | NSString * | Draft text saved in the channel. See Draft details. |
isPinned | BOOL | Whether the channel is pinned to the top. |
noDisturbLevel | NCChannelNoDisturbLevel | Do-not-disturb level for this channel. See DND Overview. |
mentionedCount | NSInteger | Total @mention count in the channel. |
mentionedMeCount | NSInteger | Number of messages where the current user is @mentioned. |
translateStrategy | NCTranslateStrategy | Text translation strategy for incoming messages. |
includeRobot | BOOL | Whether robot conversations are included. |