ShowRatingAlert
Displays a prompt for users to select a rating in-app.
- Ratings can only be submitted in the Release version, and not the Debug version.
- Under normal circumstances, the rating window should be able to pop up in the Debug version if the function works correctly.
Android quota limit:
Due to the time-bound quota on Google Play, the review dialog may not display when called multiple times within a short period of time.
For more information, see Google Play In-App Reviews API.
iOS quota limit:
StoreKit displays rating and review requests up to three times in 365 days if the user has not yet rated or reviewed your app on this device.
If the user has already rated or reviewed your app on this device, StoreKit displays ratings and review requests if the app version is new and it has been more than 365 days since the user's last review.
For more information, see requestReview.
If the Google Play Core Library's Review API components (play-core
or play-review
) are not properly integrated,
the runtime will fail to load the required classes, resulting in the following exceptions:
- ClassNotFoundException: com.google.android.play.core.review.ReviewManagerFactory
- ClassNotFoundException: com.google.android.play.core.review.ReviewManager
- ClassNotFoundException: com.google.android.play.core.tasks.OnCompleteListener
To avoid conflicts with business modules that integrate their own Google libraries, the platform layer has removed the default Google dependencies, users must now manually include them as needed.
1.Add Dependency
In the module's APL.xml
, include:
<buildGradleAdditions>
<insert>
dependencies {
implementation 'com.google.android.play:review:2.0.0'
}
</insert>
</buildGradleAdditions>
2.Proguard Rules (Required for Release Builds)
Add the following to <proguardAdditions>
in INTLCore_APL.xml
to prevent obfuscation issues with reflection:
# Preserve Play Core and Review API classes for ShowRatingAlert
-keep class com.google.android.play.core.review.** {*;}
-keep class com.google.android.play.core.tasks.** {*;}
-keep class com.google.android.gms.tasks.** {*;}
Function definition
static bool ShowRatingAlert();
Code sample
GUA_NAMESPACE::GetToolsService::ShowRatingAlert();