24.1. KakaoTalk Group Chatting SDK Example

24.1. KakaoTalk Group Chatting SDK Example

 


24.1.1. Querying KakaoTalk Group Chatting Room List

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.         }     });

Android

// [TODO] Set start value of query int offset; // Group chatting room list query start value   // [TODO] Set query list size int limit; // Group chatting room list size   // Querying KakaoTalk Group Chatting Room List KGKakaoTalkGroupChat.loadGroupChats(offset, limit, new KGResultCallback<KGKakaoTalkGroupChatsResponse>() {     @Override     public void onResult(KGResult<KGKakaoTalkGroupChatsResponse> result) {         if (result.isSuccess()) {             // Query of KakaoTalk group chatting room list successful               KGKakaoTalkGroupChatsResponse response = result.getContent();               // Total number of group chatting rooms             int totalCount = response.getTotalCount();               // Group chatting room list             List<KGKakaoTalkGroupChat> groupChats = response.getGroupChats();         } else {             // Query of KakaoTalk group chatting room list failed         }     } });

iOS

#import <KakaoGame/KakaoGame.h>   // [TODO] Set start value of query int offset = 0; // Group chatting room list query start value   // [TODO] Set query list size int limit = 10; // Group chatting room list size   // Querying KakaoTalk Group Chatting Room List [KGKakaoTalkGroupChat loadGroupChatsWithOffset:offset limit:limit completionHandler:^(NSError *error, int totalCount, NSArray *groupChats) {     if (IS_SUCCESS(error) == YES)     {         // Query of KakaoTalk group chatting room list successful           int _totalCount = totalCount; // Total number of group chatting rooms           for(KGKakaoTalkGroupChat *groupChat in groupChats)         {             long long chatId = groupChat.chatId; // Group chatting room ID             NSString *title = groupChat.title; // Group chatting room title             NSString *thumbnailImageUrl = groupChat.thumbnailImageUrl; // Group chatting room thumbnail image URL             int memberCount = groupChat.memberCount; // Number of members in the group chatting room             NSArray *memberThumbnailImageUrls = groupChat.memberThumbnailImageUrls; // Thumbnail image URL list of group chatting room members. Up to 5             KGKakaoTalkGroupChatType chatType = groupChat.chatType; // Group chatting room type (general/open)         }     }     else     {         // Query of KakaoTalk group chatting room list failed     } }];

Windows Sync

Windows Async

Unreal

24.1.2. Sending KakaoTalk Group Chatting Messages

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

Unity

Android

iOS

Windows Sync

Windows Async

Unreal