Manage channel membership by joining and leaving channels, with real-time membership status monitoring and idempotent operations
joinChannel
function allows users to join a channel, making them a member of the channel. This function takes one parameter, channelId
which is the ID of the channel that the user wishes to join.Once the user joins the channel, they will be able to participate in conversations and receive updates about the channel’s activity. It is important to note that this function is idempotent, which means that it can be called multiple times without causing any issues. If the user has already joined the channel, a successful result will still be returned.Parameter | Type | Required | Description |
---|---|---|---|
channelId | String | ✅ | Unique identifier of the channel to join |
Create vs Join vs Get Channel
channelId
, which is any string that uniquely identifies the channel and is immutable through its lifetime. When creating channels, you can specify your own channelId
, or leave it to social.plus’s Chat SDK to automatically generate one for you.Key Differences:createChannel
: Guarantees that the requested channel is new (except for conversation
type)joinChannel
: Attempts to join an existing channel and adds user to membershipgetChannel
: Only retrieves the channel Live Object but doesn’t make the current user join the channelMembership Status Management
Error Handling & Edge Cases
joinChannel
to safely retry operations, and always observe membership status for dynamic UI updates, especially to handle banned user scenarios gracefully.