Cancel Channel Subscription
Cancels channel subscription.
Call Information
UnSubscribe(string channelId) {}
Call Information Details
Parameter | Description | Type |
---|---|---|
channelId | Subscribed channel ID | string |
Callback Method Information
public void OnUnSubscribed(ChatInfoModel chatInfoModel) {}
ChatInfoModel Class Information Details
ChatInfoModel Class stores channel and sender details.
Data Key | Description | Type |
---|---|---|
gameId | Game ID | string |
channelId | Channel ID | string |
userUniqueId | User ID | string |
userName | User name | string |
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");
}
}