Gamebase에서 지원하는 부가 기능을 설명합니다.
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
FString GetDeviceLanguageCode() const;
[참고]
Gamebase의 클라이언트 메시지는 영어(en), 한글(ko), 일본어(ja)만 포함합니다.
| Code | Name |
|---|---|
| de | German |
| en | English |
| es | Spanish |
| fi | Finnish |
| fr | French |
| id | Indonesian |
| it | Italian |
| ja | Japanese |
| ko | Korean |
| pt | Portuguese |
| ru | Russian |
| th | Thai |
| vi | Vietnamese |
| ms | Malay |
| zh-CN | Chinese-Simplified |
| zh-TW | Chinese-Traditional |
해당 언어 코드는 GamebaseDisplayLanguageCode 클래스에 정의되어 있습니다.
[주의]
Gamebase에서 지원하는 언어 코드는 대소문자를 구분합니다. 'EN'이나 'zh-cn'과 같이 설정하면 문제가 발생할 수 있습니다.
namespace GamebaseDisplayLanguageCode
{
static const FString German(TEXT("de"));
static const FString English(TEXT("en"));
static const FString Spanish(TEXT("es"));
static const FString Finnish(TEXT("fi"));
static const FString French(TEXT("fr"));
static const FString Indonesian(TEXT("id"));
static const FString Italian(TEXT("it"));
static const FString Japanese(TEXT("ja"));
static const FString Korean(TEXT("ko"));
static const FString Portuguese(TEXT("pt"));
static const FString Russian(TEXT("ru"));
static const FString Thai(TEXT("th"));
static const FString Vietnamese(TEXT("vi"));
static const FString Malay(TEXT("ms"));
static const FString Chinese_Simplified(TEXT("zh-CN"));
static const FString Chinese_Traditional(TEXT("zh-TW"));
}
Gamebase 초기화 시 Display Language를 설정할 수 있습니다.
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS
void Initialize(const FGamebaseConfiguration& Configuration, const FGamebaseLaunchingInfoDelegate& Callback);
Example
void USample::Initialize(const FString& AppID, const FString& AppVersion)
{
FGamebaseConfiguration Configuration;
...
Configuration.DisplayLanguageCode = DisplayLanguage;
...
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->Initialize(Configuration, FGamebaseLaunchingInfoDelegate::CreateLambda([Subsystem](const FGamebaseLaunchingInfo* LaunchingInfo, const FGamebaseError* Error)
{
if (Gamebase::IsSuccess(Error))
{
UE_LOG(LogTemp, Display, TEXT("Initialize succeeded."));
FString DisplayLanguage = Subsystem->GetDisplayLanguageCode();
}
else
{
UE_LOG(LogTemp, Display, TEXT("Initialize failed."));
}
}));
}
Gamebase 초기화 시 입력된 Display Language를 변경할 수 있습니다.
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
void SetDisplayLanguageCode(const FString& languageCode);
Example
void USample::SetDisplayLanguageCode(const FString& DisplayLanguage)
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->SetDisplayLanguageCode(DisplayLanguage);
}
현재 적용된 Display Language를 조회할 수 있습니다.
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
FString GetDisplayLanguageCode() const;
Example
void USample::GetDisplayLanguageCode()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
FString DisplayLanguage = Subsystem->GetDisplayLanguageCode();
}
Unreal Android, iOS 플랫폼에서의 신규 언어셋 추가 방법은 아래 가이드를 참고하십시오.
초기화 및 SetDisplayLanguageCode API를 통해 Display Language를 설정할 경우, 최종 적용되는 Display Language는 입력한 값과 다르게 적용될 수 있습니다.
en이 자동으로 설정됩니다.API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS
FString GetCountryCodeOfUSIM() const;
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS
FString GetCountryCodeOfDevice() const;

API
■ UNREAL_ANDROID ■ UNREAL_IOS
FString GetCountryCode() const;
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
FDelegateHandle AddHandler(const FGamebaseEventDelegate::FDelegate& Callback);
void RemoveHandler(const FDelegateHandle& handle);
void RemoveAllHandler();
VO
struct GAMEBASE_API FGamebaseEventMessage
{
// Event 종류를 나타냅니다.
// GamebaseEventCategory 클래스의 값이 할당됩니다.
FString Category;
// 각 Category 에 맞는 VO 로 변환할 수 있는 JSON String 데이터입니다.
FString Data;
};
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::IdPRevoked))
{
auto IdpRevokedData = FGamebaseEventIdPRevokedData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::LoggedOut))
{
auto LoggedOutData = FGamebaseEventLoggedOutData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOut) ||
Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOutMessageReceived) ||
Message.Category.Equals(GamebaseEventCategory::ServerPushTransferKickout))
{
auto ServerPushData = FGamebaseEventServerPushData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::ObserverLaunching))
{
auto ObserverData = FGamebaseEventObserverData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::ObserverNetwork))
{
auto ObserverData = FGamebaseEventObserverData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::ObserverHeartbeat))
{
auto ObserverData = FGamebaseEventObserverData::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::PurchaseUpdated))
{
auto PurchasableReceipt = FGamebaseEventPurchasableReceipt::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::PushReceivedMessage))
{
auto PushMessage = FGamebaseEventPushMessage::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::PushClickMessage))
{
auto PushMessage = FGamebaseEventPushMessage::From(Message.Data);
}
else if (Message.Category.Equals(GamebaseEventCategory::PushClickAction))
{
auto PushAction = FGamebaseEventPushAction::From(Message.Data);
}
}));
}
Event 종류 |
GamebaseEventCategory | VO 변환 방법 | 비고 |
|---|---|---|---|
| IdPRevoked | GamebaseEventCategory::IdPRevoked | FGamebaseEventIdPRevokedData::From(Message.Data) | - |
| LoggedOut | GamebaseEventCategory::LoggedOut | FGamebaseEventLoggedOutData::From(Message.Data) | - |
| ServerPush | GamebaseEventCategory::ServerPushAppKickOut GamebaseEventCategory::ServerPushAppKickOutMessageReceived GamebaseEventCategory::ServerPushTransferKickout |
FGamebaseEventServerPushData::From(Message.Data) | - |
| Observer | GamebaseEventCategory::ObserverLaunching GamebaseEventCategory::ObserverNetwork GamebaseEventCategory::ObserverHeartbeat |
FGamebaseEventObserverData::From(Message.Data) | - |
| Purchase - 프로모션 결제 - 지연 결제 |
GamebaseEventCategory::PurchaseUpdated | FGamebaseEventPurchasableReceipt::From(Message.Data) | - |
| Push - 메시지 수신 |
GamebaseEventCategory::PushReceivedMessage | FGamebaseEventPushMessage::From(Message.Data) | |
| Push - 메시지 클릭 |
GamebaseEventCategory::PushClickMessage | FGamebaseEventPushMessage::From(Message.Data) | |
| Push - 액션 클릭 |
GamebaseEventCategory::PushClickAction | FGamebaseEventPushAction::From(Message.Data) | RichMessage 버튼 클릭 시 동작합니다. |
[참고]
iOS Appleid 로그인을 사용하는 경우에만 발생할 수 있는 이벤트입니다.
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::IdPRevoked))
{
// TODO: process logout, then login again.
}
}));
}
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::LoggedOut))
{
auto LoggedOutData = FGamebaseEventLoggedOutData::From(Message.Data);
if (loggedData.IsValid() == true)
{
// There was a problem with the access token.
// Call login again.
}
}
}));
}
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOut) ||
Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOutMessageReceived) ||
Message.Category.Equals(GamebaseEventCategory::ServerPushTransferKickout))
{
auto serverPushData = FGamebaseEventServerPushData::From(Message.Data);
if (serverPushData.IsVaild())
{
CheckServerPush(Message.Category, *serverPushData);
}
}
}));
}
void USample::CheckServerPush(const FString& Category, const FGamebaseEventServerPushData& Data)
{
if (Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOut))
{
// Kicked out from Gamebase server.(Maintenance, banned or etc.)
// And the game user closes the kickout pop-up.
// Return to title and initialize Gamebase again.
}
else if (Message.Category.Equals(GamebaseEventCategory::ServerPushAppKickOutMessageReceived))
{
// Currently, the kickout pop-up is displayed.
// If your game is running, stop it.
}
else if (Message.Category.Equals(GamebaseEventCategory::ServerPushTransferKickout))
{
// If the user wants to move the guest account to another device,
// if the account transfer is successful,
// the login of the previous device is released,
// so go back to the title and try to log in again.
}
}
struct GAMEBASE_API FGamebaseEventObserverData
{
// 상태값을 나타내는 정보입니다.
int32 Code;
// 추가 정보용 예비 필드입니다.
FString Message;
// 상태에 관련된 메시지 정보입니다.
FString Extras;
}
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::ObserverLaunching))
{
auto observerData = FGamebaseEventObserverData::From(Message.Data);
if (observerData.IsVaild())
{
CheckLaunchingStatus(*observerData);
}
}
else if (Message.Category.Equals(GamebaseEventCategory::ObserverNetwork))
{
auto observerData = FGamebaseEventObserverData::From(Message.Data);
if (observerData.IsVaild())
{
CheckNetwork(*observerData);
}
}
else if (Message.Category.Equals(GamebaseEventCategory::ObserverHeartbeat))
{
auto observerData = FGamebaseEventObserverData::From(Message.Data);
if (observerData.IsVaild())
{
CheckHeartbeat(*observerData);
}
}
}));
}
void USample::CheckLaunchingStatus(const FGamebaseEventObserverData& Data)
{
switch (Data.code)
{
case GamebaseLaunchingStatus::IN_SERVICE:
{
// Service is now normally provided.
break;
}
// ...
case GamebaseLaunchingStatus::INTERNAL_SERVER_ERROR:
{
// Error in internal server.
break;
}
}
}
void USample::CheckNetwork(const FGamebaseEventObserverData& Data)
{
switch ((GamebaseNetworkType)Data.code)
{
case EGamebaseNetworkType::Not:
{
// Network disconnected.
break;
}
case EGamebaseNetworkType::Mobile:
case EGamebaseNetworkType::Wifi:
case EGamebaseNetworkType::Any:
{
// Network connected.
break;
}
}
}
void USample::CheckHeartbeat(const FGamebaseEventObserverData& Data)
{
switch (Data.code)
{
case EGGamebaseErrorCode::INVALID_MEMBER:
{
// You can check the invalid user session in here.
// ex) After transferred account to another device.
break;
}
case EGGamebaseErrorCode::BANNED_MEMBER:
{
// You can check the banned user session in here.
break;
}
}
}
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::PurchaseUpdated))
{
auto purchasableReceipt = FGamebaseEventPurchasableReceipt::From(Message.Data);
if (purchasableReceipt.IsVaild())
{
// If the user got item by 'Promotion Code' or
// 'Lazy purchase', or 'Parents permission',...,
// this event will be occurred.
}
}
}));
}
VO
struct FGamebaseEventPushMessage
{
// 메시지 고유의 id입니다.
FString Id;
// Push 메시지 제목입니다.
FString Title;
// Push 메시지 본문 내용입니다.
FString Body;
// JSON 형식으로 Push 발송 시 전송했던 커스텀 정보를 확인할 수 있습니다.
FString Extras;
};
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::PushReceivedMessage))
{
auto PushMessage = FGamebaseEventPushMessage::From(Message.Data);
if (PushMessage.IsVaild())
{
// When you clicked push Message.
// By converting the extras field of the push Message to JSON,
// you can get the custom information added by the user when sending the push.
// (For Android, an 'isForeground' field is included so that you can check if received in the foreground state.)
}
}
}));
}
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::PushClickMessage))
{
auto PushMessage = FGamebaseEventPushMessage::From(Message.Data);
if (PushMessage.IsVaild())
{
// When you clicked push Message.
}
}
}));
}
VO
struct FGamebaseEventPushAction
{
// 버튼 액션 종류입니다.
FString ActionType;
// PushMessage 데이터입니다.
FGamebaseEventPushMessage Message;
// Push 콘솔에서 입력한 사용자 텍스트입니다.
FString UserText;
};
Example
void USample::AddEventHandler()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->AddEventHandler(FGamebaseEventDelegate::FDelegate::CreateLambda([](const FGamebaseEventMessage& Message)
{
if (Message.Category.Equals(GamebaseEventCategory::PushClickAction))
{
auto PushAction = FGamebaseEventPushAction::From(Message.Data);
if (PushAction.IsVaild())
{
// When you clicked action button by 'Rich Message'.
}
}
}));
}
Game지표를 Gamebase Server로 전송할 수 있습니다.
[주의]
Gamebase Analytics에서 지원하는 모든 API는 로그인 후에 호출할 수 있습니다.
[TIP]
RequestPurchase API를 호출하여 결제를 완료하면, 자동으로 지표를 전송합니다.
Analytics Console 사용법은 아래 가이드를 참고하십시오.
게임 로그인 이후 게임 유저 레벨 정보를 지표로 전송할 수 있습니다.
[주의]
게임 로그인 이후 SetGameUserData API를 호출하지 않으면 다른 지표에서 Level 정보가 누락될 수 있습니다.
API 호출에 필요한 파라미터는 아래와 같습니다.
FGamebaseAnalyticsUserData
| Name | Mandatory(M) / Optional(O) | type | Desc |
|---|---|---|---|
| UserLevel | M | int32 | 게임 유저 레벨을 나타내는 필드입니다. |
| ChannelId | O | FString | 채널을 나타내는 필드입니다. |
| CharacterId | O | FString | 캐릭터 이름을 나타내는 필드입니다. |
| CharacterClassId | O | FString | 직업을 나타내는 필드입니다. |
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
void SetGameUserData(const FGamebaseAnalyticsUserData& GameUserData);
Example
void USample::SetGameUserData(int32 UserLevel, const FString& ChannelId, const FString& CharacterId, const FString& CharacterClassId)
{
FGamebaseAnalyticsUserData GameUserData;
GameUserData.UserLevel = UserLevel;
GameUserData.ChannelId = ChannelId;
GameUserData.CharacterId = CharacterId;
GameUserData.CharacterClassId = CharacterClassId;
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->GetAnalytics()->SetGameUserData(GameUserData);
}
레벨업이 되었을 경우 게임 유저 레벨 정보를 지표로 전송할 수 있습니다.
API 호출에 필요한 파라미터는 아래와 같습니다.
LevelUpData
| Name | Mandatory(M) / Optional(O) | type | Desc |
|---|---|---|---|
| UserLevel | M | int32 | 게임 유저 레벨을 나타내는 필드입니다. |
| LevelUpTime | M | long | Epoch Time으로 입력합니다.Millisecond 단위로 입력합니다. |
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
void TraceLevelUp(const FGamebaseAnalyticesLevelUpData& levelUpData);
Example
void USample::TraceLevelUpNow(int32 UserLevel)
{
FGamebaseAnalyticesLevelUpData levelUpData{ UserLevel, FDateTime::Now().ToUnixTimestamp() };
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->GetAnalytics()->TraceLevelUp(levelUpData);
}
Gamebase 는 고객 문의 대응을 위한 기능을 제공합니다.
[TIP]
NHN Cloud Contact 서비스와 연동해서 사용하면 보다 쉽고 편리하게 고객 문의에 대응할 수 있습니다. 자세한 NHN Cloud Contact 서비스 이용법은 아래 가이드를 참고하시기 바랍니다. NHN Cloud Online Contact Guide
Gamebase 콘솔 > App > Customer service에서는 아래와 같이 3가지 유형의 고객 센터를 선택할 수 있습니다.

| Customer Service Type | Required Login |
|---|---|
| Developer customer center | X |
| Gamebase customer center | △ |
| NHN Cloud Online Contact | O |
각 유형에 따라 Gamebase SDK 의 고객 센터 API 는 다음 URL 을 사용합니다.
고객 센터 웹뷰를 표시합니다. URL은 고객 센터 유형에 따라 결정됩니다. ContactConfiguration으로 URL에 추가 정보를 전달할 수 있습니다.
FGamebaseContactConfiguration
| Parameter | Mandatory(M) / Optional(O) |
Values | Description |
|---|---|---|---|
| UserName | O | FString | 사용자 이름(닉네임) default: "" |
| AdditionalURL | O | FString | 개발사 자체 고객 센터 URL 뒤에 붙는 추가적인 URL default: "" |
| AdditionalParameters | O | TMap |
고객 센터 URL 뒤에 붙는 추가적인 파라미터 default: EmptyMap |
| ExtraData | O | TMap |
개발사가 원하는 extra data를 고객 센터 오픈 시에 전달 default: EmptyMap |
API
Supported Platforms ■ UNREAL_ANDROID ■ UNREAL_IOS ■ UNREAL_WINDOWS
void OpenContact(const FGamebaseErrorDelegate& onCloseCallback);
void OpenContact(const FGamebaseContactConfiguration& Configuration, const FGamebaseErrorDelegate& onCloseCallback);
ErrorCode
| Error Code | Description |
|---|---|
| NOT_INITIALIZED(1) | Gamebase.initialize 가 호출되지 않았습니다. |
| NOT_LOGGED_IN(2) | 고객 센터 유형이 'NHN Cloud OC' 인데 로그인 전에 호출하였습니다. |
| UI_CONTACT_FAIL_INVALID_URL(6911) | 고객 센터 URL 이 존재하지 않습니다. Gamebase 콘솔의 고객 센터 URL 을 확인하세요. |
| UI_CONTACT_FAIL_ISSUE_SHORT_TERM_TICKET(6912) | 사용자 식별을 위한 임시 티켓 발급에 실패하였습니다. |
| UI_CONTACT_FAIL_ANDROID_DUPLICATED_VIEW(6913) | 고객 센터 웹뷰가 이미 표시중입니다. |
Example
void USample::OpenContact()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->GetContact()->OpenContact(FGamebaseErrorDelegate::CreateLambda([Subsystem](const FGamebaseError* Error)
{
if (Gamebase::IsSuccess(Error))
{
UE_LOG(LogTemp, Display, TEXT("OpenContact succeeded."));
}
else
{
UE_LOG(LogTemp, Display, TEXT("OpenContact failed. (errorCode: %d, errorMessage: %s)"), Error->Code, *Error->Message);
if (Error->Code == GamebaseErrorCode::WEBVIEW_INVALID_URL)
{
// Gamebase Console Service Center URL is invalid.
// Please check the url field in the TOAST Gamebase Console.
auto LaunchingInfo = Subsystem->GetLaunching().GetLaunchingInformations();
UE_LOG(LogTemp, Display, TEXT("csUrl: %s"), *LaunchingInfo->Launching.App.RelatedUrls.CsUrl);
}
}
}));
}
고객 센터 웹뷰를 표시하는 데 사용되는 URL을 반환합니다.
API
void RequestContactURL(const FGamebaseContactUrlDelegate& Callback);
void RequestContactURL(const FGamebaseContactConfiguration& Configuration, const FGamebaseContactUrlDelegate& Callback);
ErrorCode
| Error Code | Description |
|---|---|
| NOT_INITIALIZED(1) | Gamebase.initialize 가 호출되지 않았습니다. |
| NOT_LOGGED_IN(2) | 고객 센터 유형이 'NHN Cloud OC' 인데 로그인 전에 호출하였습니다. |
| UI_CONTACT_FAIL_INVALID_URL(6911) | 고객 센터 URL 이 존재하지 않습니다. Gamebase 콘솔의 고객 센터 URL 을 확인하세요. |
| UI_CONTACT_FAIL_ISSUE_SHORT_TERM_TICKET(6912) | 사용자를 식별을 위한 임시 티켓 발급에 실패하였습니다. |
Example
void USample::RequestContactURL(const FString& userName)
{
FGamebaseContactConfiguration Configuration{ userName };
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->GetContact()->RequestContactURL(Configuration, FGamebaseContactUrlDelegate::CreateLambda([](FString url, const FGamebaseError* Error)
{
if (Gamebase::IsSuccess(Error))
{
// Open webview with 'contactUrl'
UE_LOG(LogTemp, Display, TEXT("RequestContactURL succeeded. (url = %s)"), *url);
}
else
{
UE_LOG(LogTemp, Display, TEXT("RequestContactURL failed. (errorCode: %d, errorMessage: %s)"), Error->Code, *Error->Message);
if (Error->Code == GamebaseErrorCode::UI_CONTACT_FAIL_INVALID_URL)
{
// Gamebase Console Service Center URL is invalid.
// Please check the url field in the TOAST Gamebase Console.
}
else
{
// An Error occur when requesting the contact web view url.
}
}
}));
}
API
Supported Platforms ■ UNREAL_IOS
UENUM(BlueprintType)
enum class EGamebaseAppTrackingAuthorizationStatus : uint8
{
Authorized, // 앱의 추적 요청 허용 동의, iOS 14 미만 기기에서는 항상 Authorized를 반환
Denied, // 앱의 추적 요청 허용 거부
NotDetermined, // 앱의 추적 요청 허용 미결정
Restricted, // 앱의 추적 요청 제한
Unknown // 다른 OS이거나 OS에서 정의되지 않은 경우
};
EGamebaseAppTrackingAuthorizationStatus GetAppTrackingAuthorizationStatus();
Example
void USample::GetAppTrackingAuthorizationStatus()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
EGamebaseAppTrackingAuthorizationStatus Status = Subsystem->GetUtil()->GetAppTrackingAuthorizationStatus();
switch (Status)
{
case EGamebaseAppTrackingAuthorizationStatus::Authorized:
break;
case EGamebaseAppTrackingAuthorizationStatus::Denied:
break;
case EGamebaseAppTrackingAuthorizationStatus::NotDetermined:
break;
case EGamebaseAppTrackingAuthorizationStatus::Restricted:
break;
case EGamebaseAppTrackingAuthorizationStatus::Unknown:
break;
}
}
API
Supported Platforms ■ UNREAL_IOS
FString GetIdfa();
Example
void USample::GetIdfa()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
FString Idfa = Subsystem->GetUtil()->GetIdfa();
}
Texas SB 2420 및 유사한 주 법률은 미성년자 보호를 위해 앱에서 사용자의 연령 확인을 요구합니다. Gamebase는 Google Play Age Signals API를 래핑하여 이러한 요구사항을 충족할 수 있는 API를 제공합니다.
Android에서 Age Signals 기능을 설정하는 방법은 다음 문서를 참고하세요.
연령 정보를 확인합니다.
API
Supported Platforms ■ UNREAL_ANDROID
void GetAgeSignal(const FGamebaseAgeSignalResultDelegate& Callback);
ErrorCode
| Error Code | Description |
|---|---|
| NOT_SUPPORTED(10) | Android API 23 미만 기기에서 호출되었습니다. |
| AUTH_EXTERNAL_LIBRARY_ERROR(3009) | Google Play Age Signals API에서 오류를 반환했습니다. |
Handle results
FGamebaseAgeSignalResult의 UserStatus로 유저의 상태를 확인할 수 있습니다. Status 값에 따라 사용자 규제 여부를 판단하시기 바랍니다.
EGamebaseAgeSignalsVerificationStatus
사용자 검증 상태 상수입니다.
| Status | Description |
|---|---|
| Verified | 18세 이상 성인 |
| Supervised | 보호자 동의가 있는 미성년자 |
| SupervisedApprovalPending | 보호자 승인 대기 중 |
| SupervisedApprovalDenied | 보호자 승인 거부됨 |
| Unknown | 검증되지 않은 사용자 |
Example
void USample::GetAgeSignal()
{
UGamebaseSubsystem* Subsystem = UGameInstance::GetSubsystem<UGamebaseSubsystem>(GetGameInstance());
Subsystem->GetUtil()->GetAgeSignal(
FGamebaseAgeSignalResultDelegate::CreateLambda([](const FGamebaseAgeSignalResult* AgeSignalResult, const FGamebaseError* Error)
{
if (Gamebase::IsSuccess(Error))
{
if (!AgeSignalResult->UserStatus.IsSet())
{
// 사용자가 규제 지역(텍사스, 유타, 루이지애나)에 있지 않음을 의미합니다.
// 규제 대상이 아닌 사용자에 대한 앱의 로직을 진행할 수 있습니다.
UE_LOG(LogTemp, Display, TEXT("Not legally applicable"));
}
else
{
EGamebaseAgeSignalsVerificationStatus UserStatus =
static_cast<EGamebaseAgeSignalsVerificationStatus>(AgeSignalResult->UserStatus.GetValue());
switch (UserStatus)
{
case EGamebaseAgeSignalsVerificationStatus::Verified:
{
// 18세 이상 성인 사용자
// 모든 기능에 대한 접근 허용
// AgeLower와 AgeUpper는 설정되지 않음
UE_LOG(LogTemp, Display, TEXT("Age 18 or older"));
break;
}
case EGamebaseAgeSignalsVerificationStatus::Supervised:
{
// 보호자 동의가 있는 미성년자
// Texas SB 2420에 따라 미성년자를 위한 제한된 기능 제공
// 연령대를 확인할 수 있습니다.
if (AgeSignalResult->AgeLower.IsSet() && AgeSignalResult->AgeUpper.IsSet())
{
int32 AgeLower = AgeSignalResult->AgeLower.GetValue(); // 예: 13
int32 AgeUpper = AgeSignalResult->AgeUpper.GetValue(); // 예: 17
UE_LOG(LogTemp, Display, TEXT("Supervised user, age range: %d - %d"), AgeLower, AgeUpper);
}
if (AgeSignalResult->InstallId.IsSet())
{
FString InstallId = AgeSignalResult->InstallId.GetValue();
UE_LOG(LogTemp, Display, TEXT("InstallId: %s"), *InstallId);
}
break;
}
case EGamebaseAgeSignalsVerificationStatus::SupervisedApprovalPending:
{
// 보호자 승인을 기다리는 동안 제한된 기능만 제공
// 사용자에게 승인 대기 중임을 알림
if (AgeSignalResult->MostRecentApprovalDate.IsSet())
{
int64 ApprovalDate = AgeSignalResult->MostRecentApprovalDate.GetValue();
UE_LOG(LogTemp, Display, TEXT("Approval pending since: %lld"), ApprovalDate);
}
break;
}
case EGamebaseAgeSignalsVerificationStatus::SupervisedApprovalDenied:
{
// 보호자가 승인을 거부한 경우
// 제한된 기능만 제공하거나 서비스 이용 불가 안내
UE_LOG(LogTemp, Display, TEXT("Parent or guardian has denied changes"));
break;
}
case EGamebaseAgeSignalsVerificationStatus::Unknown:
{
// 해당 관할 지역에서 검증되지 않은 사용자 또는 연령 확인 정보를 사용할 수 없는 경우
// 사용자에게 Play 스토어를 방문하여 상태를 해결하도록 요청하세요.
UE_LOG(LogTemp, Display, TEXT("User is not verified or supervised"));
break;
}
}
}
}
else
{
UE_LOG(LogTemp, Display, TEXT("GetAgeSignal failed. (errorCode: %d, errorMessage: %s)"), Error->Code, *Error->Message);
if (Error->Code == GamebaseErrorCode::NOT_SUPPORTED)
{
// Android API 23 미만 기기에서는 지원되지 않습니다.
UE_LOG(LogTemp, Display, TEXT("Age Signals API is not supported on this device"));
}
else if (Error->Code == GamebaseErrorCode::AUTH_EXTERNAL_LIBRARY_ERROR)
{
// Google Play 서비스에서 오류가 발생했습니다.
UE_LOG(LogTemp, Display, TEXT("Google Play Age Signals error"));
}
}
}));
}