버전 비교

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

...

Initialization and Status Change Event Processing

...

SDK Initialization

발췌문 삽입
초기화 및 상태변화 이벤트 처리 SDK 예제초기화 및 상태변화 이벤트 처리 SDK 예제Initialization and Status Change Event Processing SDK Example
Initialization and Status Change Event Processing SDK Example
nameapplication_init_sdk
nopaneltrue

코드 블럭
languagecpp
#include "KakaoGameV4.h"

/**
 * Perform initialization using the information set in Unreal Editor
 */
FKGTApplication::InitSDK();

Start

발췌문 삽입
EN_Initialization and Status Change Event Processing SDK ExampleEN_
Initialization and Status Change Event Processing SDK Example
nameapplication_start
nopaneltrue

코드 블럭
languagecpp
#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)
    {
      // 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] Move to the game screen.
    }
    else
    {
      // [TODO] If auto-login is not enabled, move to the login screen.
    }
  }
  else
  {
    // If the start fails - since initialization failed, 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

발췌문 삽입
초기화 및 상태변화 이벤트 처리 SDK 예제초기화 및 상태변화 이벤트 처리 SDK 예제Initialization and Status Change Event Processing SDK Example
Initialization and Status Change Event Processing SDK Example
nameapplication_pause
nopaneltrue

코드 블럭
languagecpp
#include "KakaoGameV4.h"

// Called when the game enters a background state (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) {
  // The result always returns a success (200) response.
}));

Resume

발췌문 삽입
초기화 및 상태변화 이벤트 처리 SDK 예제초기화 및 상태변화 이벤트 처리 SDK 예제Initialization and Status Change Event Processing SDK Example
Initialization and Status Change Event Processing SDK Example
nameapplication_resume
nopaneltrue

...

Setting Up Auto Login in a Windows Environment

발췌문 삽입
초기화 및 상태변화 이벤트 처리 SDK 예제초기화 및 상태변화 이벤트 처리 SDK 예제Initialization and Status Change Event Processing SDK Example
Initialization and Status Change Event Processing SDK Example
nameapplication_set_use_auto_login
nopaneltrue

코드 블럭
languagecpp
#include "KakaoGameV4.h"

// Set whether 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

...

발췌문 삽입
로그인 EN_Login SDK 예제Example로그인
EN_Login SDK 예제Example
namelogin
nopaneltrue

Logging In Without Using the Default Login UI

발췌문 삽입
로그인 EN_Login SDK 예제Example로그인
EN_Login SDK 예제Example
namelogin_custom
nopaneltrue

...

코드 블럭
#include "KakaoGameV4.h"

// The bridgeToken received through the launcher
FString bridgeToken = "";

FKGTPlayer::LoginWithBridgeToken(bridgeToken, FKGTResultDelegate::CreateLambda([=](FKGTResult result)
{
  if (result.IsSuccess())
  {
    // 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();
    // Additional information received through the launcher
    TSharedPtr<FJsonObject> bridgeTokenPayload = FKGTPlayer::GetCurrentPlayer().GetBridgeTokenPayload();
    // [TODO] Log in to the game server and proceed to the game screen
  }
  else
  {
    // Handle login failure.
    // [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, prompt the user to retry logging in.
    }
    else if (resultCode == FKGTResultCode::Forbidden)
    {
      // [TODO] During the CBT period, authentication may not be possible for users who are not allowed. Display a notification to the user, and after clicking confirm, implement the app to exit.
    }
    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, provide an error notification and prompt the user to retry logging in.
      // It is necessary to check the error code and logs to determine the cause.
    }
  }
}));

Logout

...

발췌문 삽입
로그아웃 EN_Logout SDK 예제Example로그아웃
EN_Logout SDK 예제Example
namelogout
nopaneltrue

Logging Out Without Using the Default Logout UI

발췌문 삽입
로그아웃 EN_Logout SDK 예제Example로그아웃
EN_Logout SDK 예제Example
namelogout_custom
nopaneltrue

코드 블럭
languagecpp
#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

...

발췌문 삽입
탈퇴 EN_Unregistration SDK 예제Example탈퇴
EN_Unregistration SDK 예제Example
nameunregister
nopaneltrue

Unregistering Without Using the Default Unregistration UI

발췌문 삽입
탈퇴 EN_Unregistration SDK 예제Example탈퇴
EN_Unregistration SDK 예제Example
nameunregister_custom
nopaneltrue

코드 블럭
languagecpp
#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

...

발췌문 삽입
계정 연결 SDK 예제계정 연결 SDK 예제EN_Account Linking SDK Example
EN_Account Linking SDK Example
nameconnect
nopaneltrue

Linking Accounts Without Using the Default Account Linking UI

발췌문 삽입
계정 연결 SDK 예제계정 연결 SDK 예제EN_Account Linking SDK Example
EN_Account Linking SDK Example
nameconnect_custom
nopaneltrue

...

Retrieve My Information

발췌문 삽입
프로필 EN_Profile SDK 예제Example프로필
EN_Profile SDK 예제Example
nameplayer_currentPlayer
nopaneltrue

...

Retrieve My IDP Information

발췌문 삽입
프로필 EN_Profile SDK 예제Example프로필
EN_Profile SDK 예제Example
nameplayer_idpProfile
nopaneltrue

...

Retrieve Language Code

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_language_code
nopaneltrue

...

Retrieve Country Code

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_country_code
nopaneltrue

...

Retrieve IP-based Country Code

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_geo_country_code
nopaneltrue

코드 블럭
languagecpp
#include "KakaoGameV4.h"

FString geoCountryCode = FKGTSystem::GetGeoCountryCode();

Retrieve Device ID

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_device_id
nopaneltrue

...

Retrieve Device Model

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_device_model
nopaneltrue

코드 블럭
languagecpp
#include "KakaoGameV4.h"

FString deviceModel = FKGTSystem::GetDeviceModel();

Retrieve OS Name

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_os_name
nopaneltrue

...

Retrieve Network Connection Status

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_is_network_connected
nopaneltrue

...

Retrieve Connected Network Type

발췌문 삽입
시스템 정보 SDK 예제시스템 정보 SDK 예제EN_System Information SDK Example
EN_System Information SDK Example
namesystem_network_type
nopaneltrue

...

Setting Up KakaoTalk Game Message Reception

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_show_setting
nopaneltrue

...

Retrieve KakaoTalk Profile

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_talk_profile
nopaneltrue

...

Retrieve KakaoTalk Game Friend List

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_friends
nopaneltrue

...

Sending KakaoTalk Game Messages

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_send_game_message
nopaneltrue

...

Sending KakaoTalk Friend Invitation Messages

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_send_invite_message
nopaneltrue

...

Adding a KakaoTalk Channel

발췌문 삽입
카카오 연동 기능 SDK 예제카카오 연동 기능 SDK 예제EN_Kakao Integration Feature SDK Example
EN_Kakao Integration Feature SDK Example
namekakao_talk_add_plus_friend
nopaneltrue

...