Create Channel
Create Community, Live, and Conversation channel
AmityChannelRepository
provides createChannel(with:)
method to create a new channel. It supports creating of 3 types of channels - Community
, Live
and Conversation
. Each channel type has specific builder classes which help you to create that particular channel. Build your channel information first and then create the particular channel.
Sample Code
This sample code creates a community channel with the following steps.
Create
AmityCommunityChannelBuilder
Pass the builder to
createChannel(with:)
In the case that there is already an existing channel with the same
channelID
, the API will throw an error.The
channelId
parameter can benil
. When this happens, the SDK will generate a uniquechannelId
for this channel, ensuring no unique ID conflicts.
Conversation channel is unique based on its membership. When creating conversation, the system will check if a channel with the same membership already exists. If such channel already exists, the system will return existing channel instead of creating a new one.
Create Broadcast channel
Creating a Broadcast channel is not supported in the SDK. You can create a channel of type Broadcast in console. Refer to this page for the instructions.
Last updated