In-app ratings for Android apps
In-app Ratings module helps improve app rating by allowing you to customize the appropriate location and time for prompting users to rate your application. Refer to this user guide to configure in-app ratings in the Apptics web console.
Add the SDK
- Before your begin, make sure that Apptics is integrated into your project by following the Integration Guide.
- Declaring in-app ratings dependency using Apptics BoM.
Copieddependencies {
// ...
// Apptics BoM, latest version is mentioned in the integration guide.
implementation platform('com.zoho.apptics:apptics-bom:[latest-version]')
// Since BoM version is specified, no need to explicitly specify the dependency version.
implementation 'com.zoho.apptics:apptics-ratings'
}
- If you do not use Apptics BoM you can directly declare the in-app ratings dependency with its version.
Copieddependencies {
// Have to explicitly mention the version, if you are not using BoM.
// latest version is mentioned in the integration guide.
implementation 'com.zoho.apptics:apptics-ratings:[latest-version]'
}
Note: It is recommend to use Apptics BoM to avoid unnecessary compatibility issues.
- Initialize in-app ratings SDK in application onCreate() method.
CopiedApptics.init(this)
Default rating pop-up
Default rating pop-up will be shown automatically with respect to the configuration in the web console. The default pop-up will have two or three options depending on the availability of Apptics feedback module dependency.
- 'Rate in Playstore' action will redirect the user to the PlayStore where user can add their ratings and reviews.
- 'Later' action will dismiss the rating pop-up and the pop-up will be automatically prompted again after a certain period.
- 'Send Feedback' action will be shown only if Apptics feedback SDK is added to the App. This action will redirect the user to Apptics feedback activity.
If the user chooses 'later' option in the pop-up, the next prompt will be deferred by 10 days (default). Use the below method to customize the number of days to defer the prompt.
CopiedAppticsInAppRatings.daysBeforeShowingPopupAgain = //days as int
If the user chooses 'Later' option for three consecutive times, the popup will not be shown again until the criteria for that app version is reconfigured in the Apptics web console. Use the below method to customize the max number of prompts.
CopiedAppticsInAppRatings.maxTimesToShowPopup = //number as int
Customize default ratings pop-up
Use callbackForCustomRateUsPopupUI in the init method to build and show a custom rating pop-up.
CopiedAppticsInAppRatings.customUiCallback = { activity, criteriaId ->
// build and show custom ratings pop-up
// make sure to switch to UI thread.
}
Apptics will not be able to track engagements for the customized rate us pop-up. You will have to call the sendStatsmethod to send the stats to the server.
The value of an action param can be RATE_IN_STORE_CLICKED, SEND_FEEDBACK_CLICKED, or LATER_CLICKED enum depending upon whether the button clicked is to:
- rate the app
- go to the feedback screen
- dismiss the dialog
Use PopupSource.DYNAMIC enum for the source param.
CopiedAppticsInAppRatings.sendStats(
criteriaId,
AppticsInAppRatings.PopupAction.LATER_CLICKED,
AppticsInAppRatings.PopupSource.DYNAMIC
)
Google Play in-app review API
Use the below snippet if you prefer using Google Play's in-app review system instead of Apptics' ratings pop-up.
CopiedAppticsInAppRatings.showAndroidPlayCoreAlertOnFulFillingCriteria = true
Enabling this will automatically present Google Play's in-app review system once the configured criterion is fulfilled.
Google Play review API doesn't have a callback to know whether the review UI is presented or not.
The Review API quotas are not well defined in the documentation. So, once the configured criterion is fulfilled and the Review API is invoked we will automatically defer the next review API call with respect to the value set in daysBeforeShowingPopupAgain.
Note: Refer to this link to troubleshoot in case of using Google's in-app ratings.