메시지¶
채팅 기능은 유저가 참여한 채널에 메시지를 전송하는 채널 메시지 전송과, 특정 상대방에게 직접 메시지를 전송하는 다이렉트 메시지 전송 기능을 지원합니다.
채널 메시지 전송¶
유저가 참여한 채널에 메시지를 전송하려면 ChannelSendMessageParams객체를 생성한 뒤, 이를 Chat 클래스 sendMessage() 메서드 인자로 전달해 호출합니다.
sendMessage() 메서드는 전송 결과와 전송 시 사용한 ChannelSendMessageParams를 retryParam이라는 이름으로 반환합니다. 전송에 실패했을때, retryParams를 이용하여 재전송을 시도할 수 있습니다.
ChannelSendMessageParams¶
| 필드명 | 설명 | 타입 | 필수 여부 |
|---|---|---|---|
| channelId | 채널 메시지 전송할 채널 ID | string | Y |
| message | 채널에 전송할 메시지 (최대 200자) | string | Y |
| extraData | 채널 메시지 부가정보 최대 256B Byte (UTF-8 기준) | string | N |
| replyMessageId | 답글 대상 메시지 아이디 | string | N |
| mentionedPlayerIds | 멘션 대상 플레이어 아이디 | list <long> | N |
유저가 참여한 채널에 기본 메시지를 전송하는 예제 코드는 아래와 같습니다.
using hive;
ChannelSendMessageParams channelSendMessageParams = new ChannelSendMessageParams();
channelSendMessageParams.channelId = "CHANNEL_ID";
channelSendMessageParams.message = "Hello Hive";
channelSendMessageParams.extraData = "EXTRA_DATA";
Chat.sendMessage(channelSendMessageParams, (ResultAPI result, ChannelSendMessageParams retryParams) => {
if (!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
#include "HiveChat.h"
FHiveChatChannelSendMessageParams ChannelSendMessageParams;
ChannelSendMessageParams.ChannelId = TEXT("CHANNEL_ID");
ChannelSendMessageParams.Message = TEXT("Hello Hive");
ChannelSendMessageParams.ExtraData = TEXT("EXTRA_DATA");
FHiveChat::SendMessageWithChannelSendMessageParams(ChannelSendMessageParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChatChannelSendMessageParams& RetryParams) {
if (!Result.IsSuccess) {
// Message Send Failed, Try resending using `RetryParams`
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
ChannelSendMessageParams params;
params.channelId = "CHANNEL_ID";
params.message = "Hello Hive";
params.extraData = "EXTRA_DATA";
Chat::sendMessageWithChannelSendMessageParams(params, [=](ResultAPI const & result, ChannelSendMessageParams const & retryParams) {
if (!result.isSuccess()) {
// Message Send Failed, Try resnding using `retryParams`
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
val params = Chat.ChannelSendMessageParams(
channelId = "CHANNEL_ID",
message = "Hello Hive",
extraData = "EXTRA_DATA"
)
Chat.sendMessage(params, object: Chat.SendMessageListener {
override fun onResult(
result: ResultAPI,
retryParams: Chat.ChannelSendMessageParams?
) {
if (!result.isSuccess) {
// Message Send Failed, Try resending using `retryParams`
}
}
})
#import "HIVEService.h"
HiveChatChannelSendMessageParams* sendMessageParams = [[HiveChatChannelSendMessageParams alloc] init];
sendMessageParams.channelId = "CHANNEL_ID";
sendMessageParams.message = "Hello Hive";
sendMessageParams.extraData = "EXTRA_DATA";
[HiveChat sendMessageWithChannelSendMessageParams:sendMessageParams handler:^(HIVEResultAPI * result, HiveChatChannelSendMessageParams * retryParams) {
if (![result isSuccess]) {
// Message Send Failed. Try resending using `retryParams`
}
}];
유저가 참여한 채널에서 특정 대상 메시지에 답글을 전송하는 예제 코드는 아래와 같습니다.
using hive;
ChannelSendMessageParams channelSendMessageParams = new ChannelSendMessageParams();
channelSendMessageParams.channelId = "CHANNEL_ID";
channelSendMessageParams.message = "Hello Hive";
channelSendMessageParams.replyMessageId = "TARGET_MESSAGE_ID";
Chat.sendMessage(channelSendMessageParams, (ResultAPI result, ChannelSendMessageParams retryParams) => {
if (!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
#include "HiveChat.h"
FHiveChatChannelSendMessageParams ChannelSendMessageParams;
ChannelSendMessageParams.ChannelId = TEXT("CHANNEL_ID");
ChannelSendMessageParams.Message = TEXT("Hello Hive");
ChannelSendMessageParams.ReplyMessageId = TEXT("TARGET_MESSAGE_ID");
FHiveChat::SendMessageWithChannelSendMessageParams(ChannelSendMessageParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChatChannelSendMessageParams& RetryParams) {
if (!Result.IsSuccess) {
// Message Send Failed, Try resending using `RetryParams`
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
ChannelSendMessageParams params;
params.channelId = "CHANNEL_ID";
params.message = "Hello Hive";
params.replyMessageId = "TARGET_MESSAGE_ID";
Chat::sendMessageWithChannelSendMessageParams(params, [=](ResultAPI const & result, ChannelSendMessageParams const & retryParams) {
if (!result.isSuccess()) {
// Message Send Failed, Try resnding using `retryParams`
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
val params = Chat.ChannelSendMessageParams(
channelId = "CHANNEL_ID",
message = "Hello Hive",
replyMessageId = "TARGET_MESSAGE_ID"
)
Chat.sendMessage(params, object: Chat.SendMessageListener {
override fun onResult(
result: ResultAPI,
retryParams: Chat.ChannelSendMessageParams?
) {
if (!result.isSuccess) {
// Message Send Failed, Try resending using `retryParams`
}
}
})
import com.hive.Chat;
Chat.ChannelSendMessageParams params = new Chat.ChannelSendMessageParams(
"CHANNEL_ID",
"Hello Hive",
"EXTRA_DATA",
"TARGET_MESSAGE_ID"
);
Chat.sendMessage(params, (result, retryParams) -> {
if(!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
import HIVEService
let params = HiveChatParams.ChannelSendMessageParams(
channelId = "CHANNEL_ID",
message = "Hello Hive",
replyMessageId = "TARGET_MESSAGE_ID"
)
ChatInterface.sendMessage(params) { result, retryParams in
if !result.isSuccess() {
// Message Send Failed, Try resending using `retryParams`
}
}
#import "HIVEService.h"
HiveChatChannelSendMessageParams* sendMessageParams = [[HiveChatChannelSendMessageParams alloc] init];
sendMessageParams.channelId = "CHANNEL_ID";
sendMessageParams.message = "Hello Hive";
sendMessageParams.replyMessageId = "TARGET_MESSAGE_ID";
[HiveChat sendMessageWithChannelSendMessageParams:sendMessageParams handler:^(HIVEResultAPI * result, HiveChatChannelSendMessageParams * retryParams) {
if (![result isSuccess]) {
// Message Send Failed. Try resending using `retryParams`
}
}];
유저가 참여 중인 채널에서 특정 유저를 멘션하여 메시지를 전송하는 예제 코드는 아래와 같습니다.
using hive;
ChannelSendMessageParams channelSendMessageParams = new ChannelSendMessageParams();
channelSendMessageParams.channelId = "CHANNEL_ID";
channelSendMessageParams.message = "Hello Hive";
List<long> playerIds = new List<long>();
playerIds.Add(1234); // 사용자 1 PlayerId
playerIds.Add(5678); // 사용자 2 PlayerId
channelSendMessageParams.mentionedPlayerIds = playerIds;
Chat.sendMessage(channelSendMessageParams, (ResultAPI result, ChannelSendMessageParams retryParams) => {
if (!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
#include "HiveChat.h"
FHiveChatChannelSendMessageParams ChannelSendMessageParams;
ChannelSendMessageParams.ChannelId = TEXT("CHANNEL_ID");
ChannelSendMessageParams.Message = TEXT("Hello Hive");
TArray<int64> PlayerIds;
PlayerIds.Add(1234); // 사용자 1 PlayerId
PlayerIds.Add(5678); // 사용자 2 PlayerId
ChannelSendMessageParams.MentionedPlayerIds = PlayerIds;
FHiveChat::SendMessageWithChannelSendMessageParams(ChannelSendMessageParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChatChannelSendMessageParams& RetryParams) {
if (!Result.IsSuccess) {
// Message Send Failed, Try resending using `RetryParams`
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
ChannelSendMessageParams params;
params.channelId = "CHANNEL_ID";
params.message = "Hello Hive";
std::vector<int64_t> playerIds;
playerIds.push_back(1234); // 사용자 1 PlayerId
playerIds.push_back(5678); // 사용자 2 PlayerId
params.mentionedPlayerIds = playerIds;
Chat::sendMessageWithChannelSendMessageParams(params, [=](ResultAPI const & result, ChannelSendMessageParams const & retryParams) {
if (!result.isSuccess()) {
// Message Send Failed, Try resnding using `retryParams`
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
val playerIds = listOf(1234L, 5678L) // 사용자 1, 2의 PlayerId
val params = Chat.ChannelSendMessageParams(
channelId = "CHANNEL_ID",
message = "Hello Hive",
replyMessageId = "TARGET_MESSAGE_ID",
mentionedPlayerIds = playerIds
)
Chat.sendMessage(params, object: Chat.SendMessageListener {
override fun onResult(
result: ResultAPI,
retryParams: Chat.ChannelSendMessageParams?
) {
if (!result.isSuccess) {
// Message Send Failed, Try resending using `retryParams`
}
}
})
import com.hive.Chat;
List<Long> mentionedPlayerIds = new ArrayList<>();
mentionedPlayerIds.add(1234L); // 사용자 1 PlayerId
mentionedPlayerIds.add(5678L); // 사용자 2 PlayerId
Chat.ChannelSendMessageParams params = new Chat.ChannelSendMessageParams(
"CHANNEL_ID",
"Hello Hive",
"EXTRA_DATA"
);
params.mentionedPlayerIds = mentionedPlayerIds;
Chat.sendMessage(params, (result, retryParams) -> {
if(!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
import HIVEService
var playerIds: [Int64] = [1234, 5678] // 사용자 1, 2의 PlayerId
let params = HiveChatParams.ChannelSendMessageParams(
channelId = "CHANNEL_ID",
message = "Hello Hive",
mentionedPlayerIds = playerIds
)
ChatInterface.sendMessage(params) { result, retryParams in
if !result.isSuccess() {
// Message Send Failed, Try resending using `retryParams`
}
}
#import "HIVEService.h"
HiveChatChannelSendMessageParams* sendMessageParams = [[HiveChatChannelSendMessageParams alloc] init];
sendMessageParams.channelId = @"CHANNEL_ID";
sendMessageParams.message = @"Hello Hive";
NSMutableArray<NSNumber *> *playerIds = [NSMutableArray array];
[playerIds addObject:@(1234)]; // 사용자 1 PlayerId
[playerIds addObject:@(5678)]; // 사용자 2 PlayerId
sendMessageParams.mentionedPlayerIds = playerIds;
[HiveChat sendMessageWithChannelSendMessageParams:sendMessageParams handler:^(HIVEResultAPI * result, HiveChatChannelSendMessageParams * retryParams) {
if (![result isSuccess]) {
// Message Send Failed. Try resending using `retryParams`
}
}];
채널 메시지에 리액션 추가 및 제거¶
유저가 참여한 채널에서 특정 유저의 메시지에 리액션을 추가하거나 제거할 수 있습니다. 메시지 리액션 기능으로 간편하게 기분을 표시하고, 빠른 피드백을 실시간으로 주고받으며 보다 효과적으로 게임 내 소통을 경험할 수 있습니다. 특히, 채널 내 대화 흐름을 더욱 생동감있고 직관적으로 구성할 수 있습니다.
Note
현재 제공되는 리액션 타입은 좋아요(Like) 단일 타입이며, 향후 다양한 리액션으로 확장될 예정입니다.
유저가 참여한 채널에서 특정 유저의 메시지에 리액션을 추가 혹은 제거하는 예제 코드는 아래와 같습니다.
using hive;
String messageId = "TARGET_MESSAGE_ID";
ReactionType type = ReactionType.Like;
channel.addReaction(messageId, type, (ResultAPI result, ReactionType reactionType) => {
if (result.isSuccess()) {
// API Call Success
}
});
channel.removeReaction(messageId, type, (ResultAPI result, ReactionType reactionType) => {
if (result.isSuccess()) {
// API Call Success
}
});
#include "HiveChat.h"
FString MessageId = TEXT("TARGET_MESSAGE_ID");
EReactionType Type = EReactionType::Like;
channel.AddReaction(MessageId, Type, FHiveChatOnReactionDelegate::CreateLambda([this](const FHiveResultAPI& Result, EReactionType Type) {
if (Result.IsSuccess()) {
// API Call Success
}
}));
channel.RemoveReaction(MessageId, Type, FHiveChatOnReactionDelegate::CreateLambda([this](const FHiveResultAPI& Result, EReactionType Type) {
if (Result.IsSuccess()) {
// API Call Success
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
std::string messageId = "TARGET_MESSAGE_ID";
ReactionType type = ReactionType::Like;
channel.addReaction(messageId, type, [=](ResultAPI const & result, ReactionType type) {
if (result.isSuccess()) {
// API Call Success
}
});
channel.removeReaction(messageId, type, [=](ResultAPI const & result, ReactionType type) {
if (result.isSuccess()) {
// API Call Success
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
val messageId = "TARGET_MESSAGE_ID"
val type = Chat.ReactionType.Like;
channel.addReaction(messageId, type, object: Chat.ReactionListener {
override fun onResult(result: ResultAPI, type: Chat.ReactionType) {
if (result.isSuccess()) {
// API Call Success
}
}
})
channel.removeReaction(messageId, type, object: Chat.ReactionListener {
override fun onResult(result: ResultAPI, type: Chat.ReactionType) {
if (result.isSuccess()) {
// API Call Success
}
}
})
import com.hive.Chat;
String messageId = "TARGET_MESSAGE_ID";
Chat.ReactionType type = Chat.ReactionType.Like;
Chat.addReaction(messageId, type, new Chat.ReactionListener() {
@Override
public void onResult(ResultAPI result, ReactionType type) {
if (result.isSuccess()) {
// API Call Success
}
}
});
Chat.removeReaction(messageId, type, new Chat.ReactionListener() {
@Override
public void onResult(ResultAPI result, ReactionType type) {
if (result.isSuccess()) {
// API Call Success
}
}
});
import HIVEService
let messageId = "TARGET_MESSAGE_ID"
let reactionType: ReactionType = .like
ChatInterface.addReaction(messageId: messageId, type: reactionType) { result, type in
if result.isSuccess() {
// API Call Success
}
}
ChatInterface.removeReaction(messageId: messageId, type: reactionType) { result, type in
if result.isSuccess() {
// API Call Success
}
}
#import "HIVEService.h"
NSString *messageId = @"TARGET_MESSAGE_ID";
HiveChatReactionType reactionType = HiveChatReactionTypeLike;
[channel addReactionWithMessageId:messageId type:reactionType handler:^(ResultAPI *result, HiveChatReactionType type) {
if ([result isSuccess]) {
// API Call Success
}
}];
[channel removeReactionWithMessageId:messageId type:reactionType handler:^(ResultAPI *result, HiveChatReactionType type) {
if ([result isSuccess]) {
// API Call Success
}
}];
채널 메시지 이벤트 관리¶
전송한 메시지는 addChannelListener 이벤트 핸들러 onChannelMessage이벤트로 수신할 수 있습니다. 자세한 이벤트 처리 방법은 이벤트 관리 > 채널 이벤트 문서를 참고하세요.
다이렉트 메시지 전송¶
사용자가 특정 상대방에게 직접 메시지를 전송하려면 DirectSendMessageParams객체를 생성한 뒤, 이를 Chat 클래스 sendMessage() 메서드 인자로 전달해 호출합니다.
sendMessage() 메서드는 전송 결과와 전송 시 사용한 DirectSendMessageParams를 retryParam이라는 이름으로 반환합니다. 전송에 실패했을때, retryParams를 이용하여 재전송을 시도할 수 있습니다.
DirectSendMessageParams¶
| 필드명 | 설명 | 타입 | 필수 여부 |
|---|---|---|---|
| toPlayerId | 대상 사용자의 하이브 플레이어 ID | long | Y |
| message | 대상 사용자에 전송할 메시지 (최대 200자) | string | Y |
| extraData | 다이렉트 메시지 부가정보 최대 256B Byte (UTF-8 기준) | string | N |
다음은 사용자가 특정 상대방에게 직접 메시지를 전송하는 예제 코드입니다.
using hive;
DirectSendMessageParams directSendMessageParams = new DirectSendMessageParams();
directSendMessageParams.toPlayerId = 12345678;
directSendMessageParams.message = "Hello Hive";
directSendMessageParams.extraData = "EXTRA_DATA";
Chat.sendMessage(directSendMessageParams, (ResultAPI result, DirectSendMessageParams retryParams) => {
if (!result.isSuccess()) {
// Message Send Failed, Try resending using `retryParams`
}
});
#include "HiveChat.h"
FHiveChatDirectSendMessageParams DirectSendMessageParams = FHiveChatDirectSendMessageParams();
DirectSendMessageParams.ToPlayerId = 12345678l;
DirectSendMessageParams.Message = TEXT("Hello Hive");
DirectSendMessageParams.ExtraData = TEXT("EXTRA_DATA");
FHiveChat::SendMessageWithDirectSendMessageParams(DirectSendMessageParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChatDirectSendMessageParams& RetryParams) {
if (!Result.IsSuccess) {
// Message Send Failed, Try resending using `RetryParams`
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
DirectSendMessageParams params;
params.toPlayerId = 12345678;
params.message = "Hello Hive";
params.extraData = "EXTRA_DATA";
Chat::sendMessageWithDirectSendMessageParams(params, [=](ResultAPI const & result, DirectSendMessageParams const & retryParams) {
if (!result.isSuccess()) {
// Message Send Failed, Try resnding using `retryParams`
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
val params = Chat.DirectSendMessageParams(
toPlayerId = 12345678,
message = "Hello Hive",
extraData = "EXTRA_DATA"
)
Chat.sendMessage(params, object: Chat.SendMessageListener {
override fun onResult(
result: ResultAPI,
retryParams: Chat.DirectSendMessageParams?
) {
if (!result.isSuccess) {
// Message Send Failed, Try resending using `retryParams`
}
}
})
import HIVEService
let params = HiveChatParams.DirectSendMessageParams(toPlayerId: Int64(12345678), message: "Hello Hive", extraData: "EXTRA_DATA")
ChatInterface.sendMessage(sendMessageParams: params) { result, retryParams in
if !result.isSuccess() {
// Message Send Failed, Try resending using `retryParams`
}
}
#import "HIVEService.h"
HiveChatDirectSendMessageParams* sendMessageParams = [[HiveChatDirectSendMessageParams alloc] init];
sendMessageParams.toPlayerId = 12345678;
sendMessageParams.message = @"Hello Hive";
sendMessageParams.extraData = @"EXTRA_DATA";
[HiveChat sendMessageWithDirectSendMessageParams:sendMessageParams handler:^(HIVEResultAPI * result, HiveChatDirectSendMessageParams * retryParams) {
if (![result isSuccess]) {
// Message Send Failed. Try resending using `retryParams`
}
}];
다이렉트 메시지 이벤트 관리¶
다이렉트 메시지 전송을 통해 전달된 메시지는 addUserListener 이벤트 핸들러 onDirectMessage 이벤트를 통해 수신할 수 있습니다. 자세한 이벤트 처리 방법은 이벤트 관리 > 유저 이벤트 문서를 참고하세요.
메시지 번역 요청¶
메시지에 대한 번역 요청을 시도합니다. 언어코드는 iSO 639 alpha-2를 기준으로 합니다.
TranslateParams¶
| 필드명 | 설명 | 타입 | 필수 여부 |
|---|---|---|---|
| message | 메시지 | string | Y |
| sourceLanguage | 메시지의 언어코드. 생략시 auto로 판단되어 추론. | string | N |
| targetLanguages | 번역 요청 언어코드 배열 | string array | Y |
using hive;
List<String> targetLanguages = new List<String>();
targetLanguages.Add("ko");
targetLanguages.Add("ja");
targetLanguages.Add("ar");
TranslateParams translateParams = new TranslateParams("hello", "auto", targetLanguages);
Chat.translate(translateParams, (ResultAPI result, TranslationData data) => {
if (result.isSuccess() && data != null) {
// data is translate languages
}
});
#include "HiveChat.h"
TArray<FString> TargetLanguages;
TargetLanguages.Add(TEXT("ko"));
TargetLanguages.Add(TEXT("ja"));
TargetLanguages.Add(TEXT("ar"));
FHiveChatTranslateParams TranslateParams = FHiveChatTranslateParams(TEXT("hello"), TEXT("auto"), TargetLanguages);
FHiveChat::Translate(TranslateParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChatTranslationData& data) {
if (Result.ISSuccess && data != null) {
// data is translate language messages
}
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
std::vector<std::string> targetLanguages = { "ko", "ja", "ar" };
Chat::TranslateParams translateParams = new Chat::TranslateParams("hello", "auto", targetLanguages);
Chat::translate(translateParams, [=](ResultAPI const & result, Chat::TranslationData const & data) {
if (!result.isSuccess() && data != null ) {
// data is translate language messages
}
});
import com.hive.Chat;
import com.hive.ResultAPI;
var translateParams = Chat.TranslateParams(
message = "hello",
sourceLanguage = "auto",
targetLanguages = ["ko", "ja", "ar"]
)
Chat.translate(translateParams, object: Chat.TranslateParamsListener {
override fun onResult(
result: ResultAPI,
data: Chat.TranslationData?
) {
if (!result.isSuccess && data != null) {
// data is translate language maessages
}
}
})
#import "HIVEService.h"
NSArray<NSString *> *targetLanguages = @[@"ko", @"ja", @"ar"];
HiveChatTranslateParams translateParams = [[HiveChatTranslateParams alloc] message: @"hello"
sourceLanguage: @"auto"
targetLanguages: targetLanguages];
[HiveChat translateWithParams: translateParams
handler:^(HIVEResultAPI * result, HiveChatTranslationData * data) {
if ([result isSuccess] && data) {
// data is translate language messages
}
}];
채널 메시지 신고¶
메시지를 신고하려면 ReportMessageParams객체를 생성한 뒤, 이를 Chat 클래스 reportMessage() 메서드 인자로 전달해 호출합니다.
ReportMessageParams¶
| 필드명 | 설명 | 타입 | 필수 여부 |
|---|---|---|---|
| channelId | 신고할 메시지가 있는 채널 ID | string | Y |
| messageId | 신고할 메시지 ID | string | Y |
| reporteePlayerId | 신고할 메시지를 작성한 플레이어 ID | long | Y |
| reasonType | 신고 사유 (INSULT, FRAUD, SPAM, ETC) | enum | Y |
| reasonDetail | 구체적 신고 사유 (reasonType이 ETC인 경우 입력, 그 외에는 null 또는 생략) | string | N |
기본 신고 요청 예제¶
욕설 사유로 메시지를 신고할 때는 아래 호출 방식을 사용하세요.
using hive;
ReportMessageParams reportMessageParams = new ReportMessageParams();
reportMessageParams.channelId = "abc";
reportMessageParams.messageId = "x8LIIIDbuVentUdL";
reportMessageParams.reporteePlayerId = 12345678;
reportMessageParams.reasonType = ReasonType.INSULT;
Chat.reportMessage(reportMessageParams, (ResultAPI result) => {
if (result.isSuccess()) {
// API Call Success
}
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;
ReportMessageParams reportMessageParams;
reportMessageParams.channelId = "abc";
reportMessageParams.messageId = "x8LIIIDbuVentUdL";
reportMessageParams.reporteePlayerId = 12345678;
reportMessageParams.reasonType = ReasonType.INSULT;
Chat::reportMessage(params, [=](ResultAPI const & result) {
if (result.isSuccess()) {
// API Call Success
}
});
val params = Chat.ReportMessageParam(
channelId = "abc",
messageId = "x8LIIIDbuVentUdL",
reporteePlayerId = 12345678,
reasonType = ReasonType.INSULT,
reasonDetail = null
)
Chat.reportMessage(params, object : Chat.ReportMessageListener {
override fun onResult(result: ResultAPI) {
if(result.isSuccess) {
// API Call Success
}
}
})
#import "HIVEService.h"
HiveChatReportMessageParams* reportMessageParams = [[HiveChatReportMessageParams alloc] init];
reportMessageParams.channelId = "abc";
reportMessageParams.messageId = "x8LIIIDbuVentUdL";
reportMessageParams.reporteePlayerId = 12345678;
reportMessageParams.reasonType = ReasonType.INSULT;
[HiveChat reportMessageWithReportMessageParams:reportMessageParams handler:^(HIVEResultAPI * result) {
if ([result isSuccess]) {
// API Call Success
}
}];
기타 사유로 신고하기¶
기타 사유(reasonType이 ETC)를 선택해 메시지를 신고할 때는 상세 사유(reasonDetail)를 함께 입력하세요. 미리 정의된 신고 사유를 선택하면 상세 사유는 비워 두거나 생략할 수 있습니다.