버전 비교

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

24.1. KakaoTalk Group Chatting SDK Example

...

This section shows an example of the retrieval of a user’s group chatting room list. It is sorted in order of recent chats.

API permission is required to view the list of group chat rooms. Please contact Kakao Games Business PM.

Unity

코드 블럭
using Kakaogame.SDK;
 
KGKakaoTalkGroupChat.LoadGroupChats(
    0, /* offset */
    10, /* limit */
    (result, totalCount, groupChats) => {
        if (result.isSuccess) {
            // Query of KakaoTalk group chatting room list successful.
            foreach(var groupChat in groupChats) {
                long chatId = groupChat.chatId;
                string title = groupChat.title;
                string thumbnailImageUrl = groupChats.thumbnailImageUrl;
                int memberCount = groupChat.memberCount;
                var memberThumbnailImageUrls = groupChat.memberThumbnailImageUrls;
                var chatType = groupChat.chatType;
            }
        }
        else {
            // [TODO] Query of KakaoTalk group chatting room list failed.
        }
    });

...

This section shows an example of sending a message to a group chatting room. (Guide : 20. Kakaotalk Message Template V2 )

Unity

코드 블럭
using Kakaogame.SDK;
 
KGKakaoTalkGroupChat groupChat; // Group chatting room (KGKakaoTalkGroupChat object)
string templateId = "1677";
Dictionary<string, object> argumentDic = new Dictionary<string, object>() {
    {"msg", "New Connection, New World"},
    {"iphoneMarketParam", "test"},
    {"iphoneExecParam", "test"},
    {"sender_name", "iOSTester"}
};
 
KGKakaoTalkMessage.SendNewGroupChatMessage(
    groupChat,
    templateId,
    argumentDic,
    (result) => {
        if (result.isSuccess) {
            // Sending of KakaoTalk group chatting message successful.
        }
        else if (result.code == KGResultCode.MessageSettingDisabled) {
            // If the receiver has set up message rejection
        }
        else if (result.code == KGResultCode.ExceedDailyUsage) {
            // Occurs when the daily quota (regardless of receiver) of messages from a specific app that can be sent by a user has been exceeded
        }
        else if (result.code == KGResultCode.ExceedMonthlyUsage) {
            // Occurs when the monthly quota of messages that a user can send to another specific user has been exceeded
        }
        else {
            // Other errors
        }
    });

...