Skip to content

Channel

Channel creation

To create a new conversation channel, create a CreateChannelParams object and then call the Chat class's createChannel() method.

Createchannelparams

Field Name Description Type Required
channelId Channel ID
(English letters, numbers, and some special characters (-, ., _, ~, :) allowed, up to 100 characters)
string Y
password Password (required only for PRIVATE channels)
(up to 50 characters)
string N
channelName Channel name
(up to 50 characters)
string Y
maxMemberCount Maximum number of channel participants
(minimum 2 to maximum 5,000)
integer Y
type Channel type (PRIVATE, PUBLIC, GROUP) enum Y
chatHistoryAllowed Whether chat history retrieval is allowed enum N

Here is an example code to create a new conversation channel.

using hive;

CreateChannelParams createChannelParams = new CreateChannelParams();
createChannelParams.channelId = "CHANNEL_ID";
createChannelParams.password = "";
createChannelParams.channelName = "CHANNEL_NAME";
createChannelParams.maxMemberCount = 8;
createChannelParams.type = ChannelType.PUBLIC;

Chat.createChannel(createChannelParams, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FHiveCreateChannelParams CreateChannelParams = FHiveCreateChannelParams();
CreateChannelParams.ChannelId = TEXT("CHANNEL_ID");
CreateChannelParams.Password = TEXT("");
CreateChannelParams.ChannelName = TEXT("CHANNEL_NAME");
CreateChannelParams.MaxMemberCount = 8;
CreateChannelParams.Type = EHiveChannelType::Public;

FHiveChat::CreateChannel(CreateChannelParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

CreateChannelParams param;
param.channelId = "CHANNEL_ID";
param.channelName = "CHANNEL_NAME";
param.password = "";
param.maxMemberCount = 8;
param.type = ChannelType::PUBLIC;

Chat::createChannel(param, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.CreateChannelParams(
    channelId = "CHANNEL_ID",
    password = "",
    channelName = "CHANNEL_NAME",
    maxMemberCount = 8,
    type = Chat.ChannelType.PUBLIC
)

Chat.createChannel(params, object: Chat.CreateChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

Chat.CreateChannelParams params = new Chat.CreateChannelParams(
    "CHANNEL_ID",
    "",
    "CHANNEL_NAME",
    8,
    Chat.ChannelType.PUBLIC
);

Chat.createChannel(params, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let params = Chat.CreateChannelParams(
    channelId: "CHANNEL_ID",
    password: "",
    channelName: "CHANNEL_NAME",
    maxMemberCount: 8,
    type: .public
)
ChatInterface.createChannel(params) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

HiveChatCreateChannelParams* params = [[HiveChatCreateChannelParams alloc] init];
params.channelId = @"CHANNEL_ID";
params.password = @"";
params.channelName = @"CHANNEL_NAME";
params.maxMemberCount = 8;
params.type = Chat::ChannelType::PUBLIC;

[HiveChat createChannelWithCreateParams:params handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

Channel deletion

To delete an existing conversation channel, call the Chat class deleteChannel() method.

Here is an example code for deleting a conversation channel.

using hive;

String channelId = "CHANNEL_ID";

Chat.deleteChannel(channelId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::DeleteChannel(ChannelId, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

hat::deleteChannel(commonChannelId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.deleteChannel(channelId, object: Chat.DeleteChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.deleteChannel(channelId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.deleteChannel(channelId: channelId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat deleteChannelWithChannelId:channelId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

Channel entry

To enter the existing conversation channel, create an EnterChannelParams object and then call the Chat class's enterChannel() method.

Enterchannelparams

Field Name Description Type Required
channelId Channel ID string Y
password Password (required for PRIVATE channels) string N

Here is an example code for entering a conversation channel.

using hive;

EnterChannelParams enterChannelParams = new EnterChannelParams();
enterChannelParams.channelId = "CHANNEL_ID";
enterChannelParams.password = "";

Chat.enterChannel(enterChannelParams, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FHiveEnterChannelParams EnterChannelParams = FHiveEnterChannelParams();

EnterChannelParams.ChannelId = TEXT("CHANNEL_ID");
EnterChannelParams.Password = TEXT("");

FHiveChat::EnterChannel(EnterChannelParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

EnterChannelParams param;
param.channelId = "CHANNEL_ID";
param.password = "";

Chat::enterChannel(param, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.EnterChannelParams(
    channelId = "CHANNEL_ID",
    password = ""
)

Chat.enterChannel(params, object: Chat.EnterChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

Chat.EnterChannelParams params = new Chat.EnterChannelParams(
    "CHANNEL_ID",
    ""
);

Chat.enterChannel(params, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let params = HiveChatParams.EnterChannelParams(
    channelId: "CHANNEL_ID",
    password: ""
)

ChatInterface.enterChannel(enterChannelParams: params) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

HiveChatEnterChannelParams* params = [[HiveChatEnterChannelParams alloc] init];
params.channelId = @"CHANNEL_ID";
params.password = @"";

[HiveChat enterChannelWithEnterChannelParams:params handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

Channel exit

To exit the chat channel you participated in, call the Chat class's exitChannel() method.

This is an example code for exiting a conversation channel you participated in.

using hive;

String channelId = "CHANNEL_ID";

Chat.exitChannel(channelId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::ExitChannel(ChannelId, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::exitChannel(channelId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.exitChannel(channelId, object: Chat.ExitChannelListener {
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.exitChannel(channelId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.exitChannel(channelId: channelId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat exitChannelWithChannelId:channelId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

View all channel list

To retrieve the list of all currently existing channels, create a GetChannelsParams object and then call the Chat class's getChannels() method.

Note

If you do not pass the GetChannelsParams object (passing null if no object is provided), it returns the entire list of currently existing channels without filtering.

Getchannelsparams

Field Name Description Type Required
type Channel type (PRIVATE, PUBLIC, GROUP) enum Y
channelId Retrieve channels starting with a specific channel ID string N
channelName Retrieve channels containing a specific channel name string N
sort Channel sorting criteria (ChannelId, ChannelName, RegTime) enum N
pageOrder Sorting method (ASC, DESC)
(default DESC)
string N
pageSize Number of channels to retrieve per page
(minimum 10 ~ maximum 100, default 10)
integer N
pageNumber Page number to retrieve
(starts from 1, default 1)
integer N

The Channel object and ChannelPage object are provided as a response, and the structure is as follows.

Channel

Field Name Description Type
channelId Channel ID string
type Channel type (PRIVATE, PUBLIC, GROUP) enum
owner Channel owner's Hive PlayerID string
channelName Channel name string
memberCount Current number of participating members integer
maxMemberCount Maximum number of participants in the channel integer
regTime Channel creation date and time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
regTimeMillis Channel creation date and time (Unix Timestamp) long
chatHistoryAllowed Whether channel history retrieval is allowed bool
query Method for retrieving channel message history method

Channelpage

Field Name Description Type
size Number of items per page integer
currentPage Current page number integer
totalElements Total number of items integer
totalPages Total number of pages integer

The following is an example code to retrieve the list of all existing PUBLIC type channels.

using hive;

GetChannelsParams getChannelsParams = new GetChannelsParams();
getChannelsParams.type = ChannelType.PUBLIC;

Chat.getChannels(getChannelsParams, (ResultAPI result, List<Channel> channels, ChannelPage channelPage) => {
    if (result.isSuccess()) {
        // API Call Success

        foreach (Channel channel in channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }

    }
});
#include "HiveChat.h"

TOptional<FHiveGetChannelsParams> GetChannelsParams = FHiveGetChannelsParams();
GetChannelsParams->Type = EHiveChannelType::Public;

FHiveChat::GetChannels(GetChannelsParams, FHiveChatOnGetChannelsDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveChannel>& channels, FHiveChannelPage const & channelPage) {
    if (Result.IsSuccess()) {
        // API Call Success

        for (const FHiveChannel& Channel : Channels) {
            // Retrieve Channel
        }

        if (ChannelPage != nullptr) {
            // Retrieve ChannelPage
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

Chat::GetChannelsParams params = Chat::GetChannelsParams();
params.type = Chat::ChannelType::PUBLIC;

Chat::getChannels(param, [=](ResultAPI const & result, std::vector<Channel> const & channels, ChannelPage const & pageInfo) {
    if (result.isSuccess()) {
        // API Call Success

        for (Chat::Channel channel : channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.GetChannelsParams(type = Chat.ChannelType.PUBLIC)

Chat.getChannels(params, object: Chat.GetChannelsListener{
    override fun onResult(
        result: ResultAPI,
        channels: ArrayList<Chat.Channel>,
        channelPage: Chat.ChannelPage?
    ) {
        if (result.isSuccess) {
            // API Call Success

            channels.forEach {
                // Retrieve Channel
            }
            channelPage?.let {
                // Retrieve ChannelPage
            }    
        }
    }
})
import com.hive.Chat;

Chat.GetChannelsParams params = new Chat.GetChannelsParams(Chat.ChannelType.PUBLIC, null, null, null, null, null);
Chat.getChannels(params, (result, channels, channelPage) -> {
    if (result.isSuccess()) {
        // API Call Success
        for (Chat.Channel channel : channels) {
            // Retrieve Channel
        }
        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
});
import HIVEService

let params = HiveChatParams.GetChannelsParams(type: .public, null, null, null, null, null)
ChatInterface.getChannels(getChannelsParams: params) { result, channels, pageInfo  in
    if result.isSuccess {
        channels.forEach {
            // Retrieve Channel
        }

        channelPage?.let {
            // Retrieve ChannelPage
        }
    }
}
#import "HIVEService.h"

HiveChatGetChannelsParams* params = [[HiveChatGetChannelsParams alloc] init];
params.type = Chat::ChannelType::PUBLIC;

[HiveChat getChannelsWithGetChannelsParams:params handler:^(HIVEResultAPI * result, NSArray<HiveChatChannelContent *> * channels, HiveChatPageInfo * pageInfo) {
    if (result.isSuccess) {
        // API Call Success

        for (Chat::Channel *channel : channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
}];

Channel information retrieval

To retrieve detailed information about a specific channel, call the Chat class's getChannelInfo() method.

The response includes the Channel object and the Member object, and the structure is as follows.

Channel

Field Name Description Type
channelId Channel ID string
type Channel type (PRIVATE, PUBLIC, GROUP) enum
owner Channel owner's Hive PlayerID string
channelName Channel name string
memberCount Current number of participating members integer
maxMemberCount Maximum number of channel participants integer
regTime Channel creation date and time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
regTimeMillis Channel creation date and time (Unix Timestamp) long
chatHistoryAllowed Whether channel history can be queried bool
query Method for querying channel message history method

Member

Field Name Description Type
playerId Hive PlayerID long
connectedTime Connection time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
connectedTimeeMillis Connection time (Unix Timestamp) long

The following is an example code for retrieving detailed information about a specific channel.

using hive;

String channelId = "CHANNEL_ID";

Chat.getChannelInfo(channelId, (ResultAPI result, Channel channel, List<Member> members) => {
    if (result.isSuccess()) {
        if (channel != null) {
            // Retrieve Channel
        }

        foreach (Member member in members) {
            // Retrieve Member
        }
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::GetChannelInfo(ChannelId, FHiveChatOnGetChannelInfoDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChannel& channel, const TArray<FHiveMember>& members) {
    if (Result.IsSuccess()) {
        // API Call Success

        if (channel != nullptr) {
            // Retrieve Channel
        }

        for (const FHiveMember& Member : Members) {
            // Retrieve Member
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::getChannelInfo(channelId, [=](ResultAPI const & result, Channel const & channel, std::vector<Member> const & members) {
    if (result.isSuccess()) {
        if (channel != null) {
            // Retrieve Channel
        }

        for (Chat::Member member : members) {
            // Retrieve Member
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.getChannelInfo(channelId, object: Chat.GetChannelInfoListener {
    override fun onResult(
        result: ResultAPI,
        channel: Chat.Channel?,
        members: ArrayList<Chat.Member>
    ) {
        if (result.isSuccess) {
            channel?.let {
                // Retrieve Channel
            }
            members.forEach {
                // Retrieve Member
            }
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.getChannelInfo(channelId, (result, channel, members) -> {
    if(result.isSuccess()) {
        if (channel != null) {
            // Retrieve Channel
        }
        for (Chat.Member member : members) {
            // Retrieve Member
        }
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.getChannelInfo(channelId: channelId) { result, channel, members  in
    if result.isSuccess {
        channel?.let {
            // Retrieve Channel
        }
        members.forEach {
            // Retrieve Member
        }
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat getChannelInfoWithChannelId:channelId handler:^(HIVEResultAPI * result, HiveChatChannelContent * channel, NSArray<HiveChatMember *> * members) {
    if (result.isSuccess) {
        if (channel != null) {
            // Retrieve Channel
        }
        for (Chat::Member *member : members) {
            // Retrieve Member
        }
    }
}];

Channel member inquiry

To view the channel participant members, call the Chat class's getChannelMembers() method.

Note

The response value is the same as the Member object passed from getChannelInfo().

using hive;

String channelId = "CHANNEL_ID";

Chat.getChannelMembers(channelId, (ResultAPI result, List<Member> members) => {
    if (result.isSuccess()) {
        foreach (Member member in members) {
            // Retrieve Member
        }
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::GetChannelMembers(ChannelId, FHiveChatOnGetChannelMembersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveMember>& members) {
    if (Result.IsSuccess()) {
        for (const FHiveMember& Member : members) {
            // Retrieve Member
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::getChannelMembers(channelId, [=](ResultAPI const & result, std::vector<Member> const & members) {
    if (result.isSuccess()) {
        for (Chat::Member member : members) {
            // Retrieve Member
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.getChannelMembers(channelId, object: Chat.GetChannelMembersListener{
    override fun onResult(result: ResultAPI, members: ArrayList<Chat.Member>) {
        if (result.isSuccess) {
            members.forEach { 
                // Retrieve Member
            }
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.getChannelMembers(channelId, (result, members) -> {
    if (result.isSuccess()) {
        for (Chat.Member member : members) {
            // Retrieve Member
        }
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.getChannelMembers(channelId: channelId) { result, members in
    if result.isSuccess {
        members.forEach {
            // Retrieve Member
        }
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat getChannelMembersWithChannelId:channelId handler:^(HIVEResultAPI * result, NSArray<HiveChatMember *> * members) {
    if (result.isSuccess) {
        for (Chat::Member *member : members) {
            // Retrieve Member
        }
    }
}];

Channel message history inquiry

Call the channel.query(ChannelMessageListQueryParams, ChannelMessageListQueryListener) method to retrieve previous chat history.

Only channels with the property chatHistoryAllowed set to true can retrieve history.

Channelmessagelistqueryparams

Field Name Description Type Required
size The size of the message to be received (minimum 1 ~ maximum 50) integer Y
index The index string needed for additional queries. Leave blank for the first query string Y

Channelmessagelistquerylistener

Field Name Description Type
hasNext A flag indicating whether additional queries can be made long
nextIndex The index string needed for additional queries string
content An array of retrieved ChannelMessage objects ChannelMessage
using hive;

ChannelMessageListQueryParams queryParams = new ChannelMessageListQueryParams(10, "");
channel.query(queryParams, (ResultAPI result, ChannelMessageListQueryResponse response) => {
    if (result.isSuccess() && response != null) {
        foreach (ChannelMessage message in response.content) {
            // channel message list
        }
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

ChannelMessageListQueryParams queryParams;
params.size = 10;
params.queryIndex = "";

channel.query(queryParams, [=](ResultAPI const & result, ChannelMessageListQueryResponse const & response) {
    if (result.isSuccess()) {
        for (auto message : response.message) {
            // channel message list
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val queryParams = Chat.ChannelMessageListQueryParams(size = 50)

channel.query(queryParams, object : Chat.ChannelMessageListQueryListener {
            override fun onResult(
                result: ResultAPI,
                response: Chat.ChannelMessageListQueryResponse?
            ) {
                if(result.isSuccess && response != null) {
                    response.content.forEach {
                        // channel message list
                    }
                }
            }
})
import com.hive.Chat;

Chat.ChannelMessageListQueryParams queryParams = new Chat.ChannelMessageListQueryParams(50);

channel.query(queryParams, (result, response) -> {
    if (result.isSuccess() && response != null) {
        for (HiveChatChannelMessage message : response.getContent()) {
            // channel message list
        }
    }
});
import HIVEService

let queryParams = HiveChatParams.ChannelMessageListQueryParams(size: 10, index: "")

channel.query(queryParams) { result, response in
    if result.isSuccess(),
       let contents = response.content {
        for (let message in contents) {
            // channel message list
        }
    }
}
#import "HIVEService.h"

HiveChatChannelMessageListQueryParams *queryParams = [[HiveChatChannelMessageListQueryParams alloc] initWithSize:10 index:@""];

[channel queryWithParams:queryParams listener:^(HIVEResultAPI * result, HiveChatChannelMessageListQueryResponse* response) {
    if (result.isSuccess() && response.content) {
        for (HiveChatChannelMessage *message in response.content) {
            // channel message list
        }
    }
}];

Channel automatic translation reception settings

You can set whether to receive automatic translations of messages from this channel.
The translated messages can be checked in the received ChannelMessage object.

using hive;

bool translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, (ResultAPI result) => {
    if(result.isSuccess()) {
        // Channel Message Translate set completed.
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

bool translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, [=](ResultAPI const & result) {
    if(result.isSuccess()) {
        // Channel Message Translate set completed.
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, object : Chat.SetTranslationEnabledListener {
    override fun onResult(result: ResultAPI) {
        if(result.isSuccess) {
            // Channel Message Translate set completed.
        }
    }
})
import com.hive.Chat;

boolean translateEnabled = true;

channel.setTransationEnabled(translateEnabled, (result) -> {
    if (result.isSuccess()) {
        // Channel Message Translate set completed.
    }
});
import HIVEService

let translateEnabled = true;

channel.setTranslationEnabled(translateEnabled) { result in
    if result.isSuccess() {
        // Channel Message Translate set completed.
    }
}
#import "HIVEService.h"

BOOL translateEnabled = YES;

[channel setTranslationEnabled: translateEnabled handler:^(HIVEResultAPI * result) {
    if (result.isSuccess()) {
        // Channel Message Translate set completed.
    }
}];

Channel event management

The Hive chat socket server detects connection status and continuously delivers status change events occurring between app users and channels to the app. For detailed event handling methods, please refer to the Event Management > Channel Events document.