Ratings and Reviews SDK for Unity (version 6.1.0)
General
RuStore In-app Review SDK prompts the user to rate your app and leave feedback on RuStore without exiting the app.
Rating and feedback user scenarios may be run at any time throughout the user’s path in your app. The user can rate your app from 1 to 5 and leave feedback. Feedback is optional.
Implementation example
Review the example app to learn how to correctly integrate the Reviews and Ratings SDK.
User scenario example
When to request an in-app rating and review
Use the tips below to decide when to ask the user to rate and leave feedback: (See below
-
Start the process once the user has been using your app for long enough.
-
Avoid starting it too often as this will impair your app’s user experience and limit the use or SDK ratings.
-
Avoid using calls to action like “Rate App” button as the user could have already reached the process starting limit.
-
Your app should not ask the user any questions before the start or while the process is running, including their opinion (“Do you like the app?”) or predictive questions (“Would you give this app 5 stars?”).
Design recommendations
Use the tips below to decide how to integrate the process:
-
Display the process as is, without any intervention or modification of existing design, including size, opacity, shape and other properties.
-
Add nothing on top or on sides of the process.
-
The process should open on top of all layers. Don’t close the process after starting. The process will close by itself after an express action by the user.
Connecting to the project
- Installation via .unitypackage
- Installation via Package Manager
To integrate, download the RuStoreUnityReviewSDK-version.unitypackage file and import it into your project (Assets > Import Package > Custom Package). Dependencies are resolved automatically by External Dependency Manager (bundled with the .unitypackage).
If you use macOS, adjust the Archive Utility settings. In Archive Utility preferences, clear the Keep expanding if possible checkbox. Otherwise, the project archive may be extracted incorrectly.
You can also clone the code using Git.
For proper SDK dependencies processing set the following settings.
-
Open project settings: Edit > Project Settings > Player > Android Settings.
-
In the Publishing Settings section enable to following settings.
- Custom Main Manifest.
- Custom Main Gradle Template.
- Custom Gradle Properties Template.
-
In the Other Settings section configure:
- package name.
- Minimum API Level = 24.
- Target API Level = 34.
-
Open the External Dependency Manager settings: Assets > External Dependency Manager > Android Resolver > Settings and enable the following settings.
- Use Jetifier.
- Patch mainTemplate.gradle.
- Patch gradleTemplate.properties.
-
Update project dependencies: Assets > External Dependency Manager > Android Resolver > Force Resolve.
Update
Versions 6.1.0 and later use an updated folder layout. The new structure enables the benefits of modular builds with Assembly Definition files.
Before updating, delete the following folders:
- Assets > RuStoreSDK > Review > Editor
- Assets > RuStoreSDK > Common > Editor
After deleting, import the new .unitypackage into the project as in the regular installation (Assets > Import Package > Custom Package).
To integrate, download the packages from the upm_tgz page:
ru.rustore.core-x.y.z.tgzru.rustore.review-x.y.z.tgz
Import the packages into your project via the Package Manager (Window > Package Manager > + > Add package from tarball...).
Dependencies are resolved automatically with External Dependency Manager:
- Open the Package Manager (Window > Package Manager > + > Add package from git URL...).
- Use the link
https://github.com/googlesamples/unity-jar-resolver.git?path=/upmto add the package. - To fix the
Google.IOSResolver.dll will not be loadederror, install the iOS build module for your Unity version (Unity Hub > Installs > Your Unity version > Add modules > iOS Build Support).
Assembly 'Packages/com.google.external-dependency-manager/ExternalDependencyManager/Editor/1.2.182/Google.IOSResolver.dll' will not be loaded due to errors:
Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
If you use macOS, adjust the Archive Utility settings. In Archive Utility preferences, clear the Keep expanding if possible checkbox. Otherwise, the project archive will be extracted incorrectly.
For proper SDK dependencies processing set the following settings.
-
Open project settings: Edit > Project Settings > Player > Android Settings.
-
In the Publishing Settings section enable to following settings.
- Custom Main Manifest.
- Custom Main Gradle Template.
- Custom Gradle Properties Template.
-
In the Other Settings section configure:
- package name.
- Minimum API Level = 24.
- Target API Level = 34.
-
Open the External Dependency Manager settings: Assets > External Dependency Manager > Android Resolver > Settings and enable the following settings.
- Use Jetifier.
- Patch mainTemplate.gradle.
- Patch gradleTemplate.properties.
-
Update project dependencies: Assets > External Dependency Manager > Android Resolver > Force Resolve.
Working with user ratings
Getting started with user ratings
To work with reviews, you need to create RuStoreReviewManager using RuStoreReviewManagerFactory.
RuStoreReviewManager.Instance.Init();
Preparing to request an app rating
CallRequestReviewFlow() in advance before calling LaunchReviewFlow(), to prepare necessary information to display. ReviewInfo has a lifetime — about five minutes.
RuStoreReviewManager.Instance.RequestReviewFlow(
onFailure: (error) => {
/ Handle error
},
onSuccess: () => {
/ Handle success
});
- If
onSuccess, response is received, save ReviewInfo locally to callLaunchReviewFlow. later. - If
onFailureis received, displaying the error to the user is not recommended because the user didn’t start this process.
Triggering the in-app rating flow
To run the feedback form in your app, call theLaunchReviewFlow() method using the previously obtained ReviewInfo.
RuStoreReviewManager.Instance.LaunchReviewFlow(
onFailure: (error) => {
/ Handle error
},
onSuccess: () => {
/ Handle success
});
onSuccess or onFailure to proceed with the application.
After completing the feedback form, regardless of the outcome (onSuccess or onFailure), it is not recommended to display any additional forms related to assessment and feedback.
If called frequently, launchReviewFlow will not display the feedback window to the user, as the allowed display is regulated by RuStore.
Handling errors
public class RuStoreError {
public string name;
public string description;
}
name— error name;description— error description.
onFailure.
RuStoreNotInstalledException— RuStore is not installed on the user's device;RuStoreOutdatedException— RuStore version installed on the user's device does not support this SDK;RuStoreUserUnauthorizedException— user is not authorized in RuStore;RuStoreRequestLimitReached— not enough time has passed since the process was last shown;RuStoreReviewExists— this user has already rated your app;RuStoreInvalidReviewInfo— problems withReviewInfo;RuStoreException— basic RuStore error from which other errors are inherited.