Skip to main content

Cancel Channel Subscription

Cancels channel subscription.

Call Information

UnSubscribe(string channelId) {}

Call Information Details

ParameterDescriptionType
channelIdSubscribed channel IDstring

Callback Method Information

public void OnUnSubscribed(ChatInfoModel chatInfoModel) {}

ChatInfoModel Class Information Details

ChatInfoModel Class stores channel and sender details.

Data KeyDescriptionType
gameIdGame IDstring
channelIdChannel IDstring
userUniqueIdUser IDstring
userNameUser namestring

Source Code

using UnityEngine;
using PlayNANOO.ChatServer;
using PlayNANOO.ChatServer.Models;

public class PlayNANOOChatExample : MonoBehaviour, IChatListener
{
ChatClient chatClient;

void Start()
{
chatClient = new ChatClient(this);
chatClient.SetPlayer("USER_ID", "USER_NAME");
chatClient.Connect();
}

public void OnConntected()
{
chatClient.Subscribe("CHANNEL_ID");
}

public void OnSubscribed(ChatInfoModel chatInfo)
{
chatClient.UnSubscribe("CHANNEL_ID");
}

public void OnUnSubscribed(ChatInfoModel chatInfo)
{
Debug.Log("Success");
}
}