Skip to main content

Unsubscribe from Channel

Explains how to leave (unsubscribe from) a specific channel.

Description​

Leave a specific channel by calling the ChatManager.Instance.Unsubscribe() method. After leaving, you will no longer receive messages from that channel.

Method Information​

ItemContent
MethodChatManager.Instance.Unsubscribe(string channel)
CallbackOnUnSubscribed(ChatUserInfo user) - Called when user leaves

Parameters​

ParameterTypeDescription
channelstringChannel name to unsubscribe from

Unity C# Usage Example​

using UnityEngine;

public class ChatExample : MonoBehaviour, IChatListener
{
private string myChannel = "Default Channel";

public void ExitChannel()
{
ChatManager.Instance.Unsubscribe(myChannel);
}

public void OnUnSubscribed(ChatUserInfo user)
{
Debug.Log($"{user.visitorName} left");
}

// ... Other IChatListener method implementations
}