Join channels
Requires App Context
To set up and manage channel membership, you must enable App Context for your app's keyset in the Admin Portal.
Join()
connects a user to a given channel and sets membership by creating a new Membership
object that holds the user-channel relationship. This way, the chat user can both watch the channel's content and be its full-fledged member.
After joining, the OnMessageReceived
event is triggered when a message is received. You must handle the event to receive the message.
Method signature
This method has the following signature:
1channel.Join(ChatMembershipData? membershipData = null)
Event signature
1public event Action<Message> OnMessageReceived;
Event handler signature
1void EventHandler(Message message)
* required
Parameter | Description |
---|---|
message *Type: Message Default: n/a | The received message. |
Output
This method returns an awaitable Task<ChatOperationResult>
. To receive a message, you must handle the OnMessageReceived
event.
Sample code
Join the support
channel.
1