Leave channels

Requires App Context

Enable App Context for your keyset in the Admin Portal.

Remove a user's channel membership with LeaveChannel(). The membership is deleted from App Context and other listeners receive a presence update.

Disconnect separately

LeaveChannel() only removes the membership. To stop receiving messages, call Disconnect() separately.

Method naming

Earlier versions used Leave() to destroy the membership and stop receiving messages in a single call. LeaveChannel() supersedes Leave() by separating membership removal from message unsubscription. Leave() remains available but is deprecated.

Method signature​

This method has the following signature:

1channel.LeaveChannel()

Input​

This method doesn't take any parameters.

Output​

This method returns an awaitable Task<ChatOperationResult>.

Sample code​

Leave the support channel.

1

Was this page useful?

Last updated on