버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

코드 블럭
#import <KakaoGame/KakaoGame.h>
  
// [TODO] Set World ID
int worldId = 2344;
  
// [TODO] Set Guild ID
int guildId = 2354;
 
[KGKakaoGuildChat openKakaoTalkGuildChatWithWorldId:worldId guildId:guildId completionHandler:^(NSError *error) {
    if (IS_SUCCESS(error) == YES)
    {
        // Successfully opened chat room of guild registered in KakaoTalk
    }
    else
    {
        // 카카오톡에서 가입된 길드의 채팅 방 열기 실패
        if (result.code == KGErrorNotExistData)
        {
            // No guilds joined
        }
        else if (error.code == KGErrorKakaoTalkNotInstalled)
        {
            // KakaoTalk is not installed.
        }
        else if (error.code == KGErrorNotKakaoTalkUser)
        {
            // The logged-in user is not a "Kakao Talk" user. If you are not a KakaoTalk user with the account of a user who has just registered a kakao story.
        }
        else
        {
            // Other errors
        }
    }
}];
  

Windows Sync

코드 블럭
#include "KakaoGameLib.h"
 
std::wstring worldId = TEXT("worldId"); // worldId
std::wstring guildId = TEXT("guildId"); // guildId
 
KakaoGame::Data::KGResult result; 
KakaoGame::API::KGKakaoGuildChat kgKakaoGuildChat;
   
// Open a chat room in KakaoTalk
kgKakaoGuildChat.openKakaoTalkGuildChat(worldId, guildId, result);
if (result.isSuccess()) {
    // Successfully moved to the chat tab of the Kakao Talk app
}
else {
    // Failed to move to the chat tab of the Kakao Talk app
}

Windows Async

코드 블럭
#include "KakaoGameLib.h"
 
std::wstring worldId = TEXT("worldId"); // worldId
std::wstring guildId = TEXT("guildId"); // guildId
 
KakaoGame::API::KGKakaoGuildChat kgKakaoGuildChat;
   
// Open a chat room in KakaoTalk
kgKakaoGuildChat.openKakaoTalkGuildChat(worldId, guildId, [this](KakaoGame::Data::KGResult result) {
    if (result.isSuccess()) {
        // Successfully moved to the chat tab of the Kakao Talk app
    }
    else {
        // Failed to move to the chat tab of the Kakao Talk app
    }
});

28.1.2. Send a message to the guild chat room

...

코드 블럭
#import <KakaoGame/KakaoGame.h>
 
 
// [TODO] Set World ID
int worldId = 2344;
  
// [TODO] Set Guild ID
int guildId = 2354;
  
// [TODO] Set Template ID
int templateId = 1234;
 
[KGKakaoGuildChat sendNewGuildChatMessageWithWorldId:worldId guildId:guildId templateId:templateId extra:nil completionHandler:^(NSError *error) {
    if (IS_SUCCESS(error) == YES)
    {
        //A guild message has been sent successfully.
    }
    else
    {
        //A guild message could not be been sent successfully.
    }
 
}];

Windows Sync

코드 블럭
#include "KakaoGameLib.h"
 
// [TODO] Set World ID
std::wstring worldId;
   
// [TODO] Set Guild ID
std::wstring guildId;
   
// [TODO] Set Template ID
std::wstring templateId;
 
// [TODO] Optional : Setting the value defined in the template message
std::map<std::wstring, std::wstring> arguments;
 
KakaoGame::Data::KGResult result;
KakaoGame::API::KGKakaoGuildChat kgKakaoGuildChat;
// Send guild chat message
kgKakaoGuildChat.sendGuildChatMessage(worldId, guildId, templateId, arguments, result);
if (result.isSuccess()) {
    // Successfully sending guild chat message
}
else {
    // Failed to send guild chat message
    if (KakaoGame::Data::KGResultCode::ExceedDailyUsage == result.code) {
        // Occurs when the daily quota (regardless of recipient) that one person can send for a specific app is exceeded
    }
    else {
        // Other errors
    }
}

Windows Async

코드 블럭
#include "KakaoGameLib.h"
   
// [TODO] Set World ID
std::wstring worldId;
   
// [TODO] Set Guild ID
std::wstring guildId;
   
// [TODO] Set Template ID
std::wstring templateId;
 
// [TODO] Optional : Setting the value defined in the template message
std::map<std::wstring, std::wstring> arguments;
  
KakaoGame::API::KGKakaoGuildChat kgKakaoGuildChat;
  
// Send guild chat message
kgKakaoGuildChat.sendGuildChatMessage(worldId, guildId, templateId, arguments, [this](KakaoGame::Data::KGResult result) {
    if (result.isSuccess()) {
        // Successfully sending guild chat message
    }
    else {
        // Failed to send guild chat message
        if (KakaoGame::Data::KGResultCode::ExceedDailyUsage == result.code) {
            // Occurs when the daily quota (regardless of recipient) that one person can send for a specific app is exceeded
        }
        else {
            // Other errors
        }
    }
});
정보

Message Template V2

If you use Message Template V2, please refer to the following guide. (LINK)

...