이 가이드에서는 언리얼 엔진을 사용하여 앱에 인앱 리뷰를 통합하는 방법을 설명합니다. Kotlin이나 자바, 네이티브 코드 또는 Unity를 사용한다면 별도의 통합 가이드가 있습니다.
Unreal Engine SDK 개요
Play In-App Review API는 Play Core SDK 제품군의 일부입니다. Unreal Engine용 API는 RequestReviewFlow 및 LaunchReviewFlow 메서드를 사용하여 흐름을 요청하고 시작할 수 있는 UInAppReviewsManager 클래스를 제공합니다. 요청이 이루어진 후 앱은 EInAppReviewErrorCode를 사용하여 요청 상태를 확인할 수 있습니다.
지원되는 Unreal Engine 버전
이 플러그인은 Unreal Engine 5.0 및 이후의 모든 버전을 지원합니다.
개발 환경 설정
GitHub 저장소에서 Play Unreal Engine 플러그인을 다운로드합니다.
Unreal Engine 프로젝트의
Plugins폴더 안에 있는GooglePlay폴더를 복사합니다.Unreal Engine 프로젝트를 열고 Edit(수정) → Plugins(플러그인)를 클릭합니다.
Google Play를 검색하고 사용 설정됨 체크박스를 선택합니다.
게임 프로젝트를 다시 시작하고 빌드를 트리거합니다.
프로젝트의
Build.cs파일을 열고PlayInAppReviews모듈을PublicDependencyModuleNames에 추가합니다.using UnrealBuildTool; public class MyGame : ModuleRules { public MyGame(ReadOnlyTargetRules Target) : base(Target) { // ... PublicDependencyModuleNames.Add("PlayInAppReviews"); // ... } }
인앱 리뷰 흐름 요청
인앱 리뷰를 요청하는 시기에 관한 안내에 따라 앱의 사용자 플로우에서 적절한 지점을 결정하여 사용자에게 리뷰를 요청하는 메시지를 표시합니다(예: 사용자가 게임 레벨을 끝낼 때 표시되는 요약 화면을 닫은 후). 앱이 이러한 지점 중 하나에 가까워지면 다음 예와 같이 UInAppReviewsManager를 사용하여 작업을 만듭니다.
MyClass.h
void MyClass::OnReviewOperationCompleted(EInAppReviewErrorCode ErrorCode)
{
// ...
}
MyClass.cpp
void MyClass::RequestReviewFlow()
{
// Create a delegate to bind the callback function.
FReviewOperationCompletedDelegate Delegate;
// Bind the completion handler (OnReviewOperationCompleted) to the delegate.
Delegate.BindDynamic(this, &MyClass::OnReviewOperationCompleted);
// Initiate the review flow, passing the delegate to handle the result.
GetGameInstance()
->GetSubsystem<UInAppReviewsManager>()
->RequestReviewFlow(Delegate);
}
이 메서드는 검토 작업 완료를 처리하는
FRreviewOperationCompletedDelegate를 만듭니다.대리자는 작업이 완료되면 호출되는
OnReviewOperationCompleted메서드에 바인딩됩니다.BindDynamic함수는 대리자가 콜백에 올바르게 연결되도록 합니다.RequestReviewFlow(Delegate)메서드는 검토 프로세스를 시작하고 결과를 처리할 대리자를 전달합니다.리뷰 작업은 비동기식으로 실행되므로 완료되는 동안 앱의 다른 작업을 계속할 수 있습니다.
작업이 완료되면
OnReviewOperationCompleted콜백이 성공 또는 실패를 포함한 결과를 처리합니다.
인앱 리뷰 흐름 시작
RequestReviewFlow 작업이 완료되면 인앱 리뷰 흐름을 실행할 수 있습니다. 이는 완료 이벤트를 처리하는 대리자를 결합하여 앱이 리뷰 요청의 결과(성공 또는 실패)에 반응하도록 함으로써 이루어집니다.
MyClass.h
void MyClass::OnReviewOperationCompleted(EInAppReviewErrorCode ErrorCode)
{
// ...
}
MyClass.cpp
void MyClass::LaunchReviewFlow()
{
// Create a delegate to bind the callback function.
FReviewOperationCompletedDelegate Delegate;
// Bind the completion handler (OnReviewOperationCompleted) to the delegate.
Delegate.BindDynamic(this, &MyClass::OnReviewOperationCompleted);
// Launch the review flow, passing the delegate to handle the result.
GetGameInstance()
->GetSubsystem<UInAppReviewsManager>()
->LaunchReviewFlow(Delegate);
}
다음 단계
앱의 인앱 검토 흐름 테스트를 통해 통합이 제대로 작동하는지 확인합니다.