콘솔에 이미지를 등록한 후 사용자에게 공지를 띄울 수 있습니다.
이미지 공지를 화면에 띄워 줍니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void ShowImageNotices(FGamebaseImageNoticeConfiguration& configuration, const FGamebaseErrorDelegate& onCloseCallback);
void ShowImageNotices(FGamebaseImageNoticeConfiguration& configuration, const FGamebaseErrorDelegate& onCloseCallback, const FGamebaseImageNoticeEventDelegate& onEventCallback);
Example
void Sample::ShowImageNotices(int32 colorR, int32 colorG, int32 colorB, int32 colorA, int64 timeOut)
{
FGamebaseImageNoticeConfiguration configuration{ colorR, colorG, colorB, colorA, timeOut };
IGamebase::Get().GetImageNotice().ShowImageNotices(configuration,
FGamebaseErrorDelegate::CreateLambda([=](const FGamebaseError* error) {
// Called when the entire imageNotice is closed.
...
}),
FGamebaseSchemeEventDelegate::CreateLambda([=](const FString& scheme, const FGamebaseError* error) {
// Called when custom event occurred.
...
})
);
}
Parameter | Values | Description |
---|---|---|
colorR | 0~255 | 내비게이션 바 색상 R |
colorG | 0~255 | 내비게이션 바 색상 G |
colorB | 0~255 | 내비게이션 바 색상 B |
colorA | 0~255 | 내비게이션 바 색상 Alpha |
timeOut | int64 | 이미지 공지 최대 로딩 시간 (단위 : millisecond) default: 5000 |
closeImageNotices API를 호출하여 현재 표시 중인 이미지 공지를 모두 종료할 수 있습니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void CloseImageNotices();
WebView를 표시합니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void ShowWebView(const FString& url, const FGamebaseWebViewConfiguration& configuration, FGamebaseErrorDelegate& onCloseCallback, const TArray<FString>& schemeList, const FGamebaseSchemeEventDelegate& onSchemeEvent);
Example
void Sample::ShowWebView(const FString& url)
{
FGamebaseWebViewConfiguration configuration{ TEXT("Title"), GamebaseScreenOrientation::Unspecified, 128, 128, 128, 255, 40, true, "", "" };
TArray<FString> schemeList{ TEXT("customScheme://openBrowser") };
IGamebase::Get().GetWebView().ShowWebView(url, configuration,
FGamebaseErrorDelegate::CreateLambda([=](const FGamebaseError* error) {
Result(ANSI_TO_TCHAR(__FUNCTION__), TEXT("Close webview"));
}),
schemeList,
FGamebaseSchemeEventDelegate::CreateLambda([=](const FString& scheme, const FGamebaseError* error) {
if (Gamebase::IsSuccess(error))
{
Result(ANSI_TO_TCHAR(__FUNCTION__), true, *FString::Printf(TEXT("scheme= %s"), *scheme));
}
else
{
Result(ANSI_TO_TCHAR(__FUNCTION__), false, GamebaseJsonUtil::UStructToJsonObjectString(*error));
}
}));
}
Parameter | Values | Description |
---|---|---|
title | string | WebView의 제목 |
orientation | GamebaseScreenOrientation::Unspecified | 미지정 |
GamebaseScreenOrientation::Portrait | 세로 모드 | |
GamebaseScreenOrientation::Landscape | 가로 모드 | |
GamebaseScreenOrientation::LandscapeReverse | 가로 모드를 180도 회전 | |
contentMode | GamebaseWebViewContentMode::Recommended | 현재 플랫폼 추천 브라우저 |
GamebaseWebViewContentMode::Mobile | 모바일 브라우저 | |
GamebaseWebViewContentMode::Desktop | 데스크탑 브라우저 | |
colorR | 0~255 | 내비게이션 바 색상 R |
colorG | 0~255 | 내비게이션 바 색상 G |
colorB | 0~255 | 내비게이션 바 색상 B |
colorA | 0~255 | 내비게이션 바 색상 Alpha |
buttonVisible | true or false | 뒤로 가기 버튼 활성 또는 비활성 |
barHeight | height | 내비게이션 바 높이 |
backButtonImageResource | ID of resource | 뒤로 가기 버튼 이미지 |
closeButtonImageResource | ID of resource | 닫기 버튼 이미지 |
url | "http://" or "https://" or "file://" | 웹 URL |
[TIP]
iPadOS 13 이상에서 WebView는 기본적으로 데스크탑 모드입니다. contentMode =
GamebaseWebViewContentMode.MOBILE
설정으로 모바일 모드로 변경할 수 있습니다.
Gamebase에서 지정해 놓은 Scheme입니다.
scheme | 용도 |
---|---|
gamebase://dismiss | WebView 닫기 |
gamebase://getMaintenanceInfo | 점검 내용을 WebPage에 표시 |
gamebase://getUserId | 현재 로그인된 게임 유저의 사용자 ID를 표시 |
gamebase://goBack | WebView 뒤로 가기 |
다음 API를 이용해 보이는 WebView를 닫을 수 있습니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void CloseWebView();
ExampleCloseWebview
void Sample::CloseWebView()
{
IGamebase::Get().GetWebView().CloseWebView();
}
다음 API를 통하여 외부 브라우져를 열 수 있습니다. 파라미터로 전송되는 url은 유효한 값이어야 합니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void OpenWebBrowser(const FString& url);
Example
void Sample::OpenWebBrowser(const FString& url)
{
IGamebase::Get().GetWebView().OpenWebBrowser(url);
}
시스템 알림을 표시할 수 있습니다. 시스템 알림에 콜백을 등록할 수도 있습니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void ShowAlert(const FString& title, const FString& message);
void ShowAlert(const FString& title, const FString& message, const FGamebaseAlertCloseDelegate& onCloseCallback);
Example
void Sample::ShowAlert(const FString& title, const FString& message)
{
IGamebase::Get().GetUtil().ShowAlert(title, message);
}
void Sample::ShowAlertEvent(const FString& title, const FString& message)
{
IGamebase::Get().GetUtil().ShowAlert(title, message, FGamebaseAlertCloseDelegate::CreateLambda([=]()
{
UE_LOG(GamebaseTestResults, Display, TEXT("ShowAlert ButtonClick."));
}));
}
다음 API를 사용하여 쉽게 메시지를 표시할 수 있습니다.
API
Supported Platforms ■ UNREAL_IOS ■ UNREAL_ANDROID
void ShowToast(const FString& message, EGamebaseToastExposureTime exposureTimeType);
Example
void Sample::ShowToast(const FString& message, EGamebaseToastExposureTime exposureTimeType)
{
IGamebase::Get().GetUtil().ShowToast(message, exposureTimeType);
}
Error | Error Code | Description |
---|---|---|
UI_UNKNOWN_ERROR | 6999 | 알수 없는 오류입니다(정의되지 않은 오류입니다). |