Skip to main content

Get open channel info

Open channel information — including participant count, creation time, and mute status — is returned in the NCOpenChannelEnterResponseInfo object when you call enterChannel(params:completion:).

tip

Rate limit: Per device, up to 1 call per second and at most 20 calls per minute.

Preconditions

This flow depends on successfully entering a valid open channel first.

Before calling enterChannel to retrieve channel information, make sure:

  • The open channel was already created on the server side. See Create an open channel.
  • The channelId belongs to the current appKey environment.
  • The current user is allowed to enter the channel.
swift
import NexconnChatSDK

guard let channel = OpenChannel(channelId: "channelId") else {
return
}

let params = EnterOpenChannelParams()
params.messageCount = 20

channel.enterChannel(params: params) { response, error in
if let error {
print("Failed: \(error.localizedDescription)")
return
}

guard let response else { return }
print("Channel ID: \(channel.channelId)")
print("Total participants: \(response.participantCount)")
print("Created at: \(response.createTime) ms")
print("All participants muted: \(response.isAllChannelMuted)")
print("Current user muted in this channel: \(response.isCurrentChannelMuted)")
}

NCOpenChannelEnterResponseInfo properties

PropertyTypeDescription
createTimeint64Channel creation time (millisecond timestamp)
participantCountNSIntegerCurrent participant count
enterTimeint64Current user's join time (millisecond timestamp)
isAllChannelMutedBOOLWhether the entire channel is muted
isCurrentUserMutedBOOLWhether the current user is globally muted
isCurrentChannelMutedBOOLWhether the current user is muted in this channel
isCurrentChannelInAllowlistBOOLWhether the current user is on the mute allowlist