Tích hợp các bài đánh giá trong ứng dụng (Unreal Engine)
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hướng dẫn này mô tả cách tích hợp bài đánh giá trong ứng dụng bằng cách sử dụng Unreal Engine. Sẽ có các hướng dẫn tích hợp riêng nếu bạn đang sử dụng Kotlin hoặc Java, mã gốc hoặc Unity.
Tổng quan về SDK Unreal Engine
API Bài đánh giá trong ứng dụng Play thuộc nhóm SDK Play Core. API dành cho Unreal Engine cung cấp một lớp UInAppReviewsManager để yêu cầu và khởi chạy quy trình này bằng cách sử dụng các phương thức RequestReviewFlow và LaunchReviewFlow. Sau khi một yêu cầu được thực hiện, ứng dụng của bạn có thể kiểm tra trạng thái của yêu cầu đó bằng cách sử dụng EInAppReviewErrorCode.
Các phiên bản Unreal Engine được hỗ trợ
Trình bổ trợ này hỗ trợ Unreal Engine 5.0 và tất cả các phiên bản tiếp theo.
Làm theo hướng dẫn về thời điểm yêu cầu bài đánh giá trong ứng dụng để xác định các điểm phù hợp trong luồng người dùng của ứng dụng nhằm nhắc người dùng đánh giá (ví dụ: sau khi người dùng đóng màn hình tóm tắt ở cuối một cấp trong trò chơi). Khi ứng dụng đến gần một trong các điểm sau, hãy sử dụng UInAppReviewsManager để tạo một thao tác, như minh hoạ trong ví dụ sau:
voidMyClass::RequestReviewFlow(){// Create a delegate to bind the callback function.FReviewOperationCompletedDelegateDelegate;// 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);}
Phương thức này tạo một FRreviewOperationCompletedDelegate để xử lý việc hoàn tất thao tác xem xét.
Phương thức uỷ quyền được liên kết với phương thức OnReviewOperationCompleted. Phương thức này sẽ được gọi sau khi thao tác hoàn tất.
Hàm BindDynamic đảm bảo rằng phương thức uỷ quyền được liên kết đúng cách với lệnh gọi lại.
Phương thức RequestReviewFlow(Delegate) bắt đầu quy trình xem xét, chuyển lệnh uỷ quyền để xử lý kết quả.
Thao tác xem xét chạy không đồng bộ, cho phép các tác vụ khác trong ứng dụng tiếp tục trong khi thao tác xem xét hoàn tất.
Sau khi thao tác hoàn tất, lệnh gọi lại OnReviewOperationCompleted sẽ xử lý kết quả, bao gồm cả thành công hoặc không thành công.
Chạy luồng bài đánh giá trong ứng dụng
Sau khi thao tác RequestReviewFlow hoàn tất, bạn có thể bắt đầu quy trình đánh giá trong ứng dụng. Việc này được thực hiện bằng cách liên kết một đối tượng uỷ quyền để xử lý sự kiện hoàn tất, đảm bảo ứng dụng phản ứng với kết quả (thành công hoặc không thành công) của yêu cầu xem xét.
voidMyClass::LaunchReviewFlow(){// Create a delegate to bind the callback function.FReviewOperationCompletedDelegateDelegate;// 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);}
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Integrate in-app reviews (Unreal Engine)\n\nThis guide describes how to integrate in-app reviews in your app using Unreal\nEngine. There are separate integration guides for if you are using [Kotlin or\nJava](/guide/playcore/in-app-review/kotlin-java), [native code](/guide/playcore/in-app-review/native) or [Unity](/guide/playcore/in-app-review/unity).\n\nUnreal Engine SDK overview\n--------------------------\n\nThe Play In-App Reviews API is part of Play Core SDK family. The API for Unreal\nEngine offers a `UInAppReviewsManager` class to request and launch the flow\nusing the `RequestReviewFlow` and `LaunchReviewFlow` methods. After a request is\nmade, your app can check the status of the request using\n`EInAppReviewErrorCode`.\n\nSupported Unreal Engine versions\n--------------------------------\n\nThe plugin supports **Unreal Engine 5.0** and all subsequent versions.\n\nSet up your development environment\n-----------------------------------\n\n| **Note:** If you have already used the In-app Reviews or In-app Updates plugins in Unreal Engine, you can skip to the final step.\n\n1. Download the [Play Unreal Engine Plugin](https://github.com/google/play-unreal-engine-plugin) from the GitHub\n repository.\n\n2. Copy the `GooglePlay` folder inside your `Plugins` folder in your Unreal\n Engine project.\n\n3. Open your Unreal Engine project and click **Edit → Plugins**.\n\n4. Search for **Google Play** and check the **Enabled** checkbox.\n\n5. Restart the game project and trigger a build.\n\n6. Open your project's `Build.cs` file and add the `PlayInAppReviews` module\n to `PublicDependencyModuleNames`:\n\n using UnrealBuildTool;\n\n public class MyGame : ModuleRules\n {\n public MyGame(ReadOnlyTargetRules Target) : base(Target)\n {\n // ...\n\n PublicDependencyModuleNames.Add(\"PlayInAppReviews\");\n\n // ...\n }\n }\n\nRequest the in-app review flow\n------------------------------\n\nFollow the guidance about [when to request in-app reviews](/guide/playcore/in-app-review#when-to-request) to determine good\npoints in your app's user flow to prompt the user for a review (for example,\nafter a user dismisses the summary screen at the end of a level in a game). When\nyour app gets close one of these points, use the `UInAppReviewsManager` create\nan operation, as shown in the following example:\n\nMyClass.h \n\n void MyClass::OnReviewOperationCompleted(EInAppReviewErrorCode ErrorCode)\n {\n // ...\n }\n\nMyClass.cpp \n\n void MyClass::RequestReviewFlow()\n {\n // Create a delegate to bind the callback function.\n FReviewOperationCompletedDelegate Delegate;\n\n // Bind the completion handler (OnReviewOperationCompleted) to the delegate.\n Delegate.BindDynamic(this, &MyClass::OnReviewOperationCompleted);\n\n // Initiate the review flow, passing the delegate to handle the result.\n GetGameInstance()\n -\u003eGetSubsystem\u003cUInAppReviewsManager\u003e()\n -\u003eRequestReviewFlow(Delegate);\n }\n\n1. The method creates a `FRreviewOperationCompletedDelegate` to handle the\n completion of the review operation.\n\n2. The delegate is bound to the `OnReviewOperationCompleted` method, which will\n be called once the operation finishes.\n\n3. The `BindDynamic` function ensures that the delegate is properly linked to\n the callback.\n\n4. The `RequestReviewFlow(Delegate)` method starts the review process, passing\n the delegate to handle the result.\n\n5. The review operation runs asynchronously, allowing other tasks in the app to\n continue while it completes.\n\n6. Once the operation finishes, the `OnReviewOperationCompleted` callback\n processes the result, including success or failure.\n\nLaunch the in-app review flow\n-----------------------------\n\nOnce the `RequestReviewFlow` operation is complete, you can launch the in-app\nreview flow. This is done by binding a delegate to handle the completion event,\nensuring the app reacts to the outcome (success or failure) of the review\nrequest.\n\nMyClass.h \n\n void MyClass::OnReviewOperationCompleted(EInAppReviewErrorCode ErrorCode)\n {\n // ...\n }\n\nMyClass.cpp \n\n void MyClass::LaunchReviewFlow()\n {\n // Create a delegate to bind the callback function.\n FReviewOperationCompletedDelegate Delegate;\n\n // Bind the completion handler (OnReviewOperationCompleted) to the delegate.\n Delegate.BindDynamic(this, &MyClass::OnReviewOperationCompleted);\n\n // Launch the review flow, passing the delegate to handle the result.\n GetGameInstance()\n -\u003eGetSubsystem\u003cUInAppReviewsManager\u003e()\n -\u003eLaunchReviewFlow(Delegate);\n }\n\nNext steps\n----------\n\n[Test your app's in-app review flow](/guide/playcore/in-app-review/test) to verify that your integration is\nworking correctly."]]