Skip to content

User

User participation channel inquiry

To retrieve the list of channels that the app user has participated in, call the Chat class's getChannelsByUser() method.

The Channel object is passed 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 Hive PlayerID of the channel owner string
channelName Channel name string
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

Here is an example code that retrieves the list of channels the user has participated in.

using hive;

Chat.getChannelsByUser((ResultAPI result, List<Channel> channels) => {
    if (result.isSuccess()) {
        foreach (Channel channel in channels) {
            // Retrieve Channel
        }
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

Chat::getChannelsByUser([=](ResultAPI const & result, std::vector<Channel> channels) {
    if (result.isSuccess()) {
        for (Chat::Channel channel : channels) {
            // Retrieve Channel
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

Chat.getChannelsByUser(object: Chat.GetChannelsByUserListener{
    override fun onResult(result: ResultAPI, channels: ArrayList<Chat.Channel>) {
        if (result.isSuccess) {
            channels.forEach {
                // Retrieve Channel
            }
        }
    }
})
import com.hive.Chat;

Chat.getChannelsByUser((result, channels) -> {
    if (result.isSuccess()) {
        for (Chat.Channel channel : channels) {
            // Retrieve Channel
        }
    }
});
import HIVEService

ChatInterface.getChannelsByUser { result, channels in
    if result.isSuccess {
        channels.forEach {
                // Retrieve Channel
            }
    }
}
#import "HIVEService.h"

[HiveChat getChannelsByUserWithHandler:^(HIVEResultAPI * result, NSArray<HiveChatChannelContent *> * channels) {
    if (result.isSuccess) {
        for (HiveChatChannelContent *channel in channels) {
            // Retrieve Channel
        }
    }
}];

User block list inquiry

To view the list of members blocked by the app user, call the Chat class's getBlockMembers() method.

The response will include a BlockMember object, and the structure is as follows.

Blockmember

Field Name Description Type
playerId Blocked user's PlayerID long
blockedTime Blocked time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string

The following is an example code to retrieve the list of members blocked by a user.

using hive;

Chat.getBlockMembers((ResultAPI result, List<BlockMember> blockMembers) => {
    if (result.isSuccess()) {
        foreach (BlockMember blockMember in blockMembers) {
            // Retrieve BlockMember
        }
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

Chat::getBlockMembers([=](ResultAPI const & result, std::vector<BlockMember> blockMembers) {
    if (result.isSuccess()) {
        for (Chat::BlockMember blockMember : blockMembers) {
            // Retrieve BlockMember
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

Chat.getBlockMembers(object: Chat.GetBlockMembersListener{
    override fun onResult(result: ResultAPI, blockMembers: ArrayList<Chat.BlockMember>) {
        if (result.isSuccess) {
            blockMembers.forEach {
                // Retrieve BlockMember
            }
        }
    }
})
import com.hive.Chat;

Chat.getBlockMembers((result, blockMembers) -> {
    if (result.isSuccess()) {
        for (Chat.BlockMember blockMember : blockMembers) {
            // Retrieve BlockMember
        }
    }
});
import HIVEService

ChatInterface.getBlockMembers { result, blockMembers in
    if result.isSuccess {
        blockMembers.forEach {
            // Retrieve BlockMember
        }
    }
}
#import "HIVEService.h"

[HiveChat getBlockMembersWithHandler:^(HIVEResultAPI * result, NSArray<HiveChatBlockMember *> * blockMembers) {
    if (result.isSuccess) {
        for (HiveChatBlockMember* blockMember in blockMembers) {
            // Retrieve BlockMember
        }
    }
}];

User block

To block a specific member, the app user calls the Chat class blockMember() method.

The following is an example code for a user to block a specific member.

using hive;

Int64 blockPlayerId = 12345678;
Chat.blockMember(blockPlayerId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

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

val blockPlayerId = 12345678L
Chat.blockMember(blockPlayerId, object : Chat.BlockMemberListener {
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

long blockPlayerId = 12345678;
Chat.blockMember(blockPlayerId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let blockPlayerId: Int64 = 12345678
ChatInterface.blockMember(blockPlayerId: blockPlayerId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

int64_t blockPlayerId = 12345678;
[HiveChat blockMemberWithBlockPlayerId:blockPlayerId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

Unblock user

To unblock a member, call the Chat class unblockMember() method.

The following is an example code for a user to unblock a member.

using hive;

Int64 blockedPlayerId = 12345678;
Chat.unblockMember(blockedPlayerId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

int64_t blockedPlayerId = 12345678;
Chat::unblockMember(blockPlayerId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val blockedPlayerId = 12345678L
Chat.unblockMember(blockedPlayerId, object : Chat.UnblockMemberListener {
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

long blockedPlayerId = 12345678;
Chat.unblockMember(blockedPlayerId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let blockedPlayerId: Int64 = 12345678
ChatInterface.unblockMember(blockedPlayerId: blockedPlayerId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

int64_t blockedPlayerId = 12345678;
[HiveChat unblockMemberWithBlockPlayerId:blockedPlayerId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];