Get open channel info
Open channel information — including member 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.
- Swift
- Objective-C
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 members: \(response.memberCount)")
print("Created at: \(response.createTime) ms")
print("All members muted: \(response.isAllChannelMuted)")
print("Current user muted in this channel: \(response.isCurrentChannelMuted)")
}
Objective C
NCOpenChannel *channel = [[NCOpenChannel alloc] initWithChannelId:@"channelId"];
NCEnterOpenChannelParams *params = [[NCEnterOpenChannelParams alloc] init];
params.messageCount = 20;
[channel enterChannelWithParams:params completion:^(NCOpenChannelEnterResponseInfo *response, NCError *error) {
if (error == nil) {
NSLog(@"Channel ID: %@", channel.channelId);
NSLog(@"Total members: %ld", (long)response.memberCount);
NSLog(@"Created at: %lld ms", response.createTime);
NSLog(@"All members muted: %d", response.isAllChannelMuted);
NSLog(@"Current user muted in this channel: %d", response.isCurrentChannelMuted);
} else {
NSLog(@"Failed: %@", error);
}
}];
NCOpenChannelEnterResponseInfo properties
| Property | Type | Description |
|---|---|---|
createTime | int64 | Channel creation time (millisecond timestamp) |
memberCount | NSInteger | Current member count |
enterTime | int64 | Current user's join time (millisecond timestamp) |
isAllChannelMuted | BOOL | Whether the entire channel is muted |
isCurrentUserMuted | BOOL | Whether the current user is globally muted |
isCurrentChannelMuted | BOOL | Whether the current user is muted in this channel |
isCurrentChannelInAllowlist | BOOL | Whether the current user is on the mute allowlist |