목차 | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
...
Initialization and Status Change Event Processing
...
SDK
...
Initialization
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" /** * Unreal Editor에 설정한 정보로 초기화 수행 Perform initialization using the information set in Unreal Editor */ FKGTApplication::InitSDK(); |
...
Start
...
발췌문 삽입 | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FKGTApplication::Start(FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 스타트가If the 성공start 한is 경우successful // 자동로그인Check 여부if auto-login is enabled bool isLoggedIn = FKGTPlayer::IsLoggedIn(); if (isLoggedIn) { // 플랫폼에서 발급한 현재 Player의 IDThe current Player's ID issued by the platform FString playerId = FKGTPlayer::GetCurrentPlayer().GetPlayerId(); // 플랫폼Platform 엑세스access 토큰token FString accessToken = FKGTPlayer::GetAccessToken(); // 현재Retrieve the current IDP 인증authentication 정보를information 가져옴 FKGTIdpProfile idpProfile = FKGTPlayer::GetCurrentPlayer().GetIdpProfile(); // [TODO] 게임Move to 화면으로the 이동game 합니다screen. } else { // [TODO] 자동로그인이 안 된 경우 로그인 화면으로 이동 합니다If auto-login is not enabled, move to the login screen. } } else { // 스타트가If 실패the 한start 경우fails - 초기화가 실패한 경우 이므로 스타트를 재시도 하거나 앱을 종료 하여야 합니다Initialization failed, so you should either retry the start or close the app. int32 resultCode = result.GetCode(); if (resultCode == FKGTResultCode::NetworkFailure || resultCode == FKGTResultCode::ServerTimeout || resultCode == FKGTResultCode::ServerConnectionFailed) { // [TODO] 네트워크 에러가 발생한 경우에는 유저에게 네트워크 이슈로 스타트에 실패했음을 알리고 재시도If a network error occurs, notify the user that the start failed due to a network issue and retry. } else { // [TODO] 나머지If 에러가other 발생한errors 경우에는occur, 에러notify 안내the 후user 스타트 재시도 요청 하여야 합니다. - 문제가 반복해서 발생하는 경우 에러코드 및 로그 확인 후 원인 파악이 필요합니다and request a retry of the start process. If the issue persists, check the error code and logs to determine the cause. } } })); |
Pause
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // Called when 게임이the 백그라운드game 상태enters 일a 때background 호출됩니다state (예 : 다른 앱으로 전환하거나 홈 버튼을 통해 종료) // ApplicationWillEnterBackgroundDelegate를 이용하여 SDK Pause가 호출 될 수 있도록 등록합니다e.g., switching to another app or exiting via the home button). // Register with ApplicationWillEnterBackgroundDelegate so that SDK Pause can be called. FCoreDelegates::ApplicationWillEnterBackgroundDelegate.AddUObject(this, &UApplicationWidget::Pause); FKGTApplication::Pause(FKGTResultDelegate::CreateLambda([=](FKGTResult result) { // result는 항상 성공The result always returns a success (200) 응답을 반환합니다response. })); |
Resume
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 게임이 포그라운드로 돌아갈 때 호출됩니다 Called when the game returns to the foreground // ApplicationHasEnteredForegroundDelegate를Register with 이용하여ApplicationHasEnteredForegroundDelegate SDKso Resume이that 호출SDK 될Resume 수can 있도록be 등록합니다called. FCoreDelegates::ApplicationHasEnteredForegroundDelegate.AddUObject(this, &UApplicationWidget::Resume); FKGTApplication::Resume(FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // [TODO] resume이 성공 한 경우 게임 화면을 재개합니다If the resume is successful, resume the game screen. } else { // [TODO] resume이 실패 한 경우 인증 실패 면 로그인 화면으로, 그외의 경우는 에러 팝업을 띄우고 재시도 여부를 확인합니다 If the resume fails, if it's an authentication failure, go to the login screen; otherwise, show an error popup and check whether to retry. if (result.Code == FKGTResultCode::AuthFailure || result.Code == FKGTResultCode::IdpAuthFailure) { // [TODO] 인증In 실패의case 경우of 시작authentication 화면으로failure, 이동해서 다시 신규 로그인 flow를 수행합니다move to the start screen and perform the new login flow again. } else { // [TODO] 나머지If 에러가other 발생한errors 경우occur, 경우provide 에러an 안내error 후notification resumeand 을retry 재시도the 합니다resume. -If 반복해서the 문제가issue 발생하는persists, 경우close 앱을the 종료하도록 합니다app. } } }); |
...
Setting Up Auto Login in a Windows Environment
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 자동로그인사용Set 유무를whether 세팅, 세팅하지 않으면 사용하지 않음 상태로 세팅 // 자동로그인사용설정으로 로그인이 성공하면 자동로그인정보가 생성됨 // 자동로그인정보가 존재하면 다음 KGTApplication의 start시에 자동로그인이 진행됨으로 자동로그인정보를 제거하려면 로그아웃을 진행해야함to use auto-login; if not set, it defaults to not using auto-login // When auto-login is enabled and login is successful, auto-login information is generated // If auto-login information exists, auto-login will proceed automatically during the next KGTApplication start, so to remove the auto-login information, you need to log out bool useAutoLogin = true; FKGTApplication::SetUseAutoLogin(useAutoLogin); |
...
Login
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Logging In Without Using the Default Login UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // Set 로그인the 하고자IdpCode 하는for IdpCodethe 셋팅login EKGTIdpCode idpCode = EKGTIdpCode::Kakao; // Log 특정in with idp로a 로그인specific 하기IDP FKGTPlayer::Login(idpCode, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 플랫폼에서 발급한 현재 Player의 ID The current Player's ID issued by the platform FString playerId = FKGTPlayer::GetCurrentPlayer().GetPlayerId(); // 플랫폼Platform 엑세스access 토큰token FString accessToken = FKGTPlayer::GetAccessToken(); // 현재Retrieve the current IDP 인증authentication 정보를information 가져옴 FKGTIdpProfile idpProfile = FKGTPlayer::GetCurrentPlayer().GetIdpProfile(); // [TODO] 로그인이 성공하였으므로 게임 화면으로 이동합니다Since the login was successful, proceed to the game screen. } else { // IDP 로그인login 혹은or 플랫폼platform 로그인login 실패failed // [TODO] 로그인If 실패login 시fails, 사용자inform 안내the 후user 재and 시도prompt 하도록them 하여야to 합니다retry. int32 resultCode = result.GetCode(); if (resultCode == FKGTResultCode::NetworkFailure || resultCode == FKGTResultCode::ServerTimeout || resultCode == FKGTResultCode::ServerConnectionFailed) { // [TODO] 네트워크 에러가 발생한 경우에는 유저에게 네트워크 이슈로 스타트에 실패했음을 알리고 재시도 If a network error occurs, notify the user that the start failed due to a network issue and prompt to retry. } else if (resultCode == FKGTResultCode::Forbidden) { // [TODO] During the CBT period, authentication may not be // [TODO] CBT기간동안 허용된 유저외에는 인증이 불가능 할 수 있습니다. 유저에게 안내메시지 처리가 필요합니다possible for users who are not allowed. Provide an appropriate notification to the user. } else if (resultCode == FKGTResultCode::UserCanceled) { // [TODO] 사용자가 로그인 진행 중 취소한 상황이므로 로그인 화면을 유지 하여야 합니다Since the user canceled during the login process, the login screen should be maintained. } else { // [TODO] If other errors occur, notify // [TODO] 나머지 에러가 발생한 경우에는 에러 안내 후 로그인 재시도 요청 하여야 합니다. - 에러코드 및 로그 확인 후 원인 파악이 필요합니다the user and prompt them to retry the login. It is necessary to check the error code and logs to determine the cause. } } })); |
...
Logout
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Logging Out Without Using the Default Logout UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 로그아웃Logout 요청request FKGTPlayer::Logout(FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 로그아웃Logout 성공successful // [TODO] Return 시작to the 화면으로start 돌아가기screen } else { // 로그아웃Logout 실패failed } })); |
...
Unregistration
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Unregistering Without Using the Default Unregistration UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 탈퇴 요청 Unregistration (account deletion) request FKGTPlayer::Unregister(showUI, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 탈퇴Unregistration 성공successful // [TODO] 시작 화면으로 돌아가기Return to the start screen } else { // 탈퇴Unregistration 실패failed } })); |
...
Account Linking
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Linking Accounts Without Using the Default Account Linking UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // Set 로그인the 하고자IdpCode 하는for IdpCodethe 셋팅login EKGTIdpCode idpCode = EKGTIdpCode::Kakao; // Connect 특정the account idp로with 계정a 연결specific 하기IDP FKGTPlayer::Connect(idpCode, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // IDP connection successful 연결 성공 // The Player ID 는does 변경되지not 않습니다change. } else { // IDP 연결connection 실패failed int32 resultCode = result.GetCode(); if (resultCode == FKGTResultCode::NotAuthorized) { // 현재 로그인이 안되어 있는 경우If the current session is not logged in } else if (resultCode == FKGTResultCode::InvalidState) { // 현재If the 인증currently 된authenticated IDP 가is 계정not 연결eligible 가능한for idp가account 아닌connection 경우 } else if (resultCode == FKGTResultCode::AlreadyUsedIDPAccount) { // 이미 연결되어 있는 계정이 있는 경우 If the account is already connected to another IDP } else { // 기타Other 에러errors 발생occurred } } })); |
프로필
...
Profile
...
Retrieve My Information
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FKGTPlayer player = FKGTPlayer::GetCurrentPlayer(); // 플랫폼Platform playerId FString playerId = player.GetPlayerId(); // 플랫폼Platform AccessToken FString accessToken = FKGTPlayer::GetAccessToken(); // idpProfile 정보information FKGTIdpProfile idpProfile = player.GetIdpProfile(); |
...
Retrieve My IDP
...
Information
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FKGTPlayer player = FKGTPlayer::GetCurrentPlayer(); // Retrieve IDP 정보information 조회 FKGTIdpProfile idpProfile = player.GetIdpProfile(); EKGTIdpCode idpCode = idpProfile.GetIdpCode(); FString idpUserId = idpProfile.GetIdpUserId(); // Retrieve 카카오Kakao IDP 정보information 조회 // 카카오 로그인 상태인 경우If the login state is with Kakao if (idpCode == EKGTIdpCode::Kakao) { // 카카오Retrieve Kakao IDP 정보 조회information FKGTKakaoProfile *kakaoProfile = (FKGTKakaoProfile*)&idpProfile; // 카카오Kakao UUID FString uuid = kakaoProfile->GetUUID(); // If the same Kakao //user 다른is 앱에서using 동일한a 카카오different 유저인app, 경우return 같은the 그룹same 유저group 토큰을user 반환token FString groupUserToken = kakaoProfile->GetGroupUserToken(); // 오늘 보낼 수 있는 남은 초대 수Remaining number of invites that can be sent today int32 remainingInviteCount = kakaoProfile->GetRemainingInviteCount(); // 앱 가입 여부Whether the app is registered bool isAppRegistered = kakaoProfile->IsAppRegistered(); // Whether 메시지message reception 수신is 여부allowed bool isAllowedMessage = kakaoProfile->IsAllowedMessage(); } |
시스템 정보
...
System Information
...
Retrieve Language Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString languageCode = FKGTSystem::GetLanguageCode(); |
...
Retrieve Country Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString countryCode = FKGTSystem::GetCountryCode(); |
...
Retrieve IP-based Country Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString geoCountryCode = FKGTSystem::GetGeoCountryCode(); |
...
Retrieve Device ID
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString deviceId = FKGTSystem::GetDeviceId(); |
...
Retrieve Device Model
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString deviceModel = FKGTSystem::GetDeviceModel(); |
Retrieve OS
...
Name
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString osName = FKGTSystem::GetOSName(); |
...
Retrieve Network Connection Status
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" bool isNetworkConnected = FKGTSystem::IsNetworkConnected(); |
...
Retrieve Connected Network Type
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" FString networkType = FKGTSystem::GetNetworkType(); |
카카오 연동 기능
...
Kakao Integration Feature
...
Setting Up KakaoTalk Game Message Reception
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 카카오톡 게임 메시지 수신 여부 설정 뷰 띄우기Display the view to set KakaoTalk game message reception preferences FKGTKakaoTalk::ShowSetting(FKGTResultWithIsAllowMeDelegate::CreateLambda([=](FKGTResult result, bool isAllowMe) { if (result.IsSuccess()) { // 카카오톡Successfully 게임set 메시지KakaoTalk 수신game 여부message 설정reception 성공preferences // isAllowMe - 설정된 메시지 수신 허용 여부Whether message reception is allowed as per the settings } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // Failed 카카오톡to 게임set 메시지KakaoTalk 수신game 여부message 설정reception 실패preferences } })); |
...
KakaoTalk Profile Retrieval
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 카카오톡Retrieve 프로필KakaoTalk 조회하기profile FKGTKakaoTalk::TalkProfile(FKGTResultWithKakaoTalkProfileDelegate::CreateLambda([=](FKGTResult result, FKGTKakaoTalkProfile profile) { if (result.IsSuccess()) { // 카카오톡Successfully 프로필retrieved 조회KakaoTalk 성공profile // profile - 로그인한 유저의 카카오톡 프로필 정보 The KakaoTalk profile information of the logged-in user } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // 카카오톡Failed to 프로필retrieve 조회KakaoTalk 실패profile } })); |
...
Retrieving KakaoTalk Game Friend List
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // 게임Retrieve 친구game 목록friend 조회하기list FKGTKakaoTalk::Friends(FKGTResultWithPlayerListDelegate::CreateLambda([=](FKGTResult result, TArray<FKGTPlayer> playerList) { if (result.IsSuccess()) { // 카카오톡Successfully 게임retrieved 친구KakaoTalk 목록game 조회friend 성공list. for (FKGTPlayer player : playerList) { FKGTIdpProfile idpProfile = player.GetIdpProfile(); FKGTKakaoFriendProfile *kakaoFriendProfile = (FKGTKakaoFriendProfile*)&idpProfile; } } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우 The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // Failed 카카오톡to 게임retrieve 친구KakaoTalk 목록game 조회friend 실패list } })); |
...
Sending KakaoTalk Game Messages
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // Kakao friendsfriend API를profile 통해retrieved 가져온through 카카오the 친구friends 프로필API FKGTKakaoFriendProfile *kakaoFriendProfile; // [TODO] 템플릿Set the Idtemplate 설정ID FString templateId = TEXT(""); // [TODO] 메시지 템플릿에 설정한 인자 설정Set the parameters for the message template TMap<FString, FString> argumentDic; argumentDic.Add(TEXT("${nickname}"), kakaoFriendProfile->GetNickname()); argumentDic.Add(TEXT("rog_link"), TEXT("test=100&hello=20111")); // 카카오톡Send a 게임KakaoTalk 메시지game 보내기message FKGTKakaoTalk::SendGameMessage((*kakaoFriendProfile), templateId, argumentDic, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 카카오톡Successfully sent 채팅the 메시지KakaoTalk 보내기chat 성공message } else { if (result.GetCode() == FKGTResultCode::MessageSettingDisabled) { // The recipient has set //up 받은이가message 메시지reception 수신to 거부를be 설정한disabled 경우 } else if (result.GetCode() == FKGTResultCode::ExceedDailyUsage) { // 한명이 특정 앱에 대해 보낼 수 있는 하루 쿼터(받는 사람 관계없이) 초과시 발생 Exceeded the daily quota of messages that can be sent by one person for a specific app (regardless of the recipient) } else if (result.GetCode() == FKGTResultCode::ExceedMonthlyUsage) { // Exceeded the monthly quota of messages that can //be 한명이sent 특정by 앱에one 대해person 특정인에게to 보낼a 수specific 있는recipient 한달for 쿼터a 초과시specific 발생app } else { // 카카오톡 채팅 메시지 보내기 실패Failed to send the KakaoTalk chat message } } })); |
...
Sending KakaoTalk Friend Invitation Messages
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // [TODO] 팝업창으로 띄울지 여부 설정Set whether to display in a popup window bool isSingle = true; // [TODO] 팝업창으로 띄울지 여부 설정 Set whether to display in a popup window bool isPopup = true; // [TODO] Set 템플릿the Idtemplate 설정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 받은이가up 메시지message 수신reception 거부를to 설정한be 경우disabled } else if (result.GetCode() == FKGTResultCode::ExceedDailyUsage) { // 한명이 특정 앱에 대해 보낼 수 있는 하루 쿼터(받는 사람 관계없이) 초과시 발생 Exceeded the daily quota of messages that can be sent by one person for a specific app (regardless of the recipient) } else if (result.GetCode() == FKGTResultCode::ExceedMonthlyUsage) { // 한명이 특정 앱에 대해 특정인에게 보낼 수 있는 한달 쿼터 초과시 발생/ Exceeded the monthly quota of messages that can be sent by one person to a specific recipient for a specific app } else { // 카카오톡Failed to 채팅send 메시지KakaoTalk 보내기chat 실패message } } })); |
...
Adding a KakaoTalk Channel
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // [TODO] Set 채널the Idchannel 설정ID int32 channelId = 0; FKGTKakaoTalk::AddChannel(channelId, FKGTResultDelegate::CreateLambda([=](FKGTResult result) { if (result.IsSuccess()) { // 채널Successfully added 추가the 성공channel } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // Failed 채널to add 추가the 실패channel } })); |
...
Retrieve the list of friends to whom I sent an invite message
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // [TODO] 이벤트Set the Idevent 설정ID int32 eventId = 0; // 내가 초대한 플레이어 목록 조회하기Retrieve the list of players I invited FKGTKakaoInvitation::Joiners(eventId, FKGTResultWithJoinersDelegate::CreateLambda([=](FKGTResult result, TArray<FKGTPlayer> players) { if (result.IsSuccess()) { // 내가 초대한 플레이어 목록 가져오기 Successfully retrieved the list of players I invited for (FKGTPlayer player : players) { // 수신자의Recipient's 플레이어player 아이디ID FString playerId = player.GetPlayerId(); FKGTIdpProfile idpProfile = player.GetIdpProfile(); FKGTKakaoFriendProfile *kakaoProfile = (FKGTKakaoFriendProfile*)&idpProfile; // 수신자의Recipient's 닉네임nickname FString nickname = kakaoProfile->GetNickname(); // 수신자의Recipient's 프로필profile 썸네일thumbnail 이미지image FString thumbnailImageUrl = kakaoProfile->GetThumbnailImageUrl(); // 수신지의 탈퇴 이력 조회. UI상에서 탈퇴 여부 정보를 표시할 경우 해당 flag를 사용Check if the recipient has a withdrawal history. Use this flag to display withdrawal information in the UI. bool isUnregistered = kakaoProfile->IsUnregistered(); } } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // The logged-in user is not a // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // 호출 실패 Failed to retrieve the list } })); |
...
Retrieve the count of friends to whom I sent an invite message
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameV4.h" // [TODO] 이벤트Set the Idevent 설정ID int32 eventId = 0; // Retrieve 내가the count 초대한of 플레이어players 목록I 조회하기invited FKGTKakaoInvitation::ReceiversCount(eventId, FKGTResultWithReceiversCountDelegate::CreateLambda([=](FKGTResult result, int32 totalReceiversCount, int32 joinersCount) { if (result.IsSuccess()) { // Successfully 호출retrieved the 성공counts // totalReceiversCount - 전체Total number 친구of 수friends // joinersCount - 게임에 가입한 친구 수 Number of friends who joined the game } else if (result.GetCode() == FKGTResultCode::NotKakaoTalkUser) { // 로그인 한 유저가 '카카오톡' 유저가 아닙니다. (카카오톡 유저가 아닌 경우 The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user) } else { // 호출 실패 Failed to retrieve the counts } })); |