Show in-app rating (ShowRatingAlert)
Show in-app rating.
- The debug version cannot submit a rating, while the release version can.
- Under normal circumstances, the debug version can pop up the rating dialog as a functionality check.
Android Quota Limitation Explanation:
The Google Play official limit stipulates that frequent calls to the rating interface in a short time may not always display the dialog box.
For more information, see Google Play In-App Review API.
iOS Quota Limitation Explanation:
If the user has not yet rated or reviewed your application on this device, StoreKit will show the rating and review request up to three times within 365 days.
If the user has already rated or reviewed your application on this device, StoreKit will show the rating and review request if the application version is new, and more than 365 days have passed since the user's last review.
For more information, see iOS Rating Mechanism.
如果未正确集成Google Play Core库的Review API组件(play-core或play-review),将会导致运行时无法加载相关类。
- 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 Google libraries integrated by the business, the platform layer has removed Google dependencies and now the business party should introduce them as needed.
1. Add dependencies
You can add the following to the module's APL.xml:
<buildGradleAdditions>
<insert>
dependencies {
implementation 'com.google.android.play:review:2.0.0'
}
</insert>
</buildGradleAdditions>
2. Proguard rules (required for release versions)
In <proguardAdditions> of INTLCore_APL.xml, add the following to prevent reflection-related obfuscation issues:
# ShowRatingAlert needs to exclude play-core and review libraries from obfuscation to avoid reflection issues
-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 Example
GUA_NAMESPACE::GetToolsService::ShowRatingAlert();