/ SDKs / Unity
SDKs
Chat SDKs Unity v4
Chat SDKs Unity
Chat SDKs
Unity
Version 4

Categorize channels by custom type

Copy link

When creating an open channel or a group channel, you can additionally specify a custom channel type to subclassify channels. This custom type takes on the form of String, and can be useful when searching or filtering channels.

The Data and CustomType properties of a channel object allow you to append information to channels. While both properties can be used flexibly, common examples for CustomType include categorizing channels as "School" or "Work".


Open channel

Copy link

To get an open channel's custom type, refer to openChannel.customType.

SbOpenChannelCreateParams openChannelCreateParams = new SbOpenChannelCreateParams();
openChannelCreateParams.CustomType = NAME;
openChannelCreateParams.CustomType = CUSTOM_TYPE;
SendbirdChat.OpenChannel.CreateChannel(openChannelCreateParams, (inChannel, inError) =>
{
if (inError != null)
return; //Handle error.
});

SbOpenChannelCreateParams

Copy link
Property nameTypeDescription

name

string

Specifies the name of the channel.

customType

string

Specifies the custom channel type which is used for channel grouping.


Group channel

Copy link

To get a group channel's custom type, refer to groupChannel.customType.

final params = GroupChannelCreateParams()
  ..name = NAME
  ..customType = CUSTOM_TYPE
  ..userIds = ['Jed', 'Young'];

try {
  final groupChannel = await GroupChannel.createChannel(params);
} catch (e) {
  // Handle error.
}

SbGroupChannelCreateParams

Copy link
Property nameTypeDescription

name

string

Specifies the name of the channel.

customType

string

Specifies the custom channel type which is used for channel grouping.

inUserIds

string

Specifies the list of users.