Skip to main content
Version: 5.7.0

ChannelDisconnect

Disconnects from the specified channel, unregistering the handler.

ServiceOperation
chatCHANNEL_DISCONNECT

Method Parameters

ParameterDescription
channelIdThe id of the channel to connect to.

Usage

http://localhost:3000


string channelId = "22817:gl:CHAT_TRADE"; // APP_ID:CHANNEL_TYPE:CHANNEL_ID
SuccessCallback successCallback = (response, cbObject) =>
{
Dictionary<string, object> jsonMessage = (Dictionary<string, object>)JsonFx.Json.JsonReader.Deserialize(response);
var status = jsonMessage["status"].ToString();

string logMessage = string.Join(" | ", new [] {status});
Debug.Log(logMessage); // 200
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("[ChannelDisconnect Failed] {0} {1} {2}", status, code, error));
};

_bc.ChatService.ChannelDisconnect(channelId, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {}
}
Common Error Code

Status Codes

CodeNameDescription
40346CHAT_INVALID_CHANNEL_IDThe channel id provided is invalid.
40601RTT_NOT_ENABLEDRTT must be enabled for this feature