#include "KakaoGameV4.h"
// [TODO] Set whether to display as a popup window
bool isSingle = true;
// [TODO] Set whether to display as a popup window
bool isPopup = true;
// [TODO] Set the template ID
FString templateId = TEXT("");
// [TODO] Set the parameters for the message template
TMap<FString, FString> argumentDic;
argumentDic.Add(TEXT("${nickname}"), TEXT("nickname"));
FKGTKakaoTalk::SendInviteMessage(isSingle, isPopup, templateId, argumentDic, FKGTResultWithKakaoUserListDelegate::CreateLambda([=](FKGTResult result, TArray<FKGTKakaoUser> users)
{
if (result.IsSuccess())
{
// Successfully sent KakaoTalk invite message
for (FKGTKakaoUser user : users)
{
// Check the list of users to whom the invite message was sent
}
}
else
{
// If all failed (need to return a common cause)
if (result.GetCode() == FKGTResultCode::MessageSettingDisabled)
{
// The recipient has set message reception to be disabled
}
else if (result.GetCode() == FKGTResultCode::ExceedDailyUsage)
{
// Occurs when the daily quota for sending messages to a specific app (regardless of the recipient) is exceeded.
}
else if (result.GetCode() == FKGTResultCode::ExceedMonthlyUsage)
{
// Occurs when the monthly quota for sending messages to a specific person for a specific app is exceeded.
}
else
{
// Failed to send KakaoTalk chat message
}
}
})); |