Ratings and Reviews SDK for Defold (version 9.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
- Copy the plugin projects from the official RuStore repository on GitFlic.
- Copy the contents
review_example/extension_rustore_reviewandreview_example/extension_rustore_coreto the root folder of your project.
Working with user ratings
Getting started with user ratings
Before calling library methods, you must initialise the library. Use the init() method for initialisation.
function init(self)
rustorereview.init()
end
Preparing to request an app rating
Callrequest_review_flow in advance before calling launch_review_flow, to prepare necessary information to display. ReviewInfo has a lifetime — about five minutes.
You must subscribe to events once before using this method:
on_request_review_flow_success;on_request_review_flow_failure.
function init(self)
rustorecore.connect("rustore_request_review_flow_success", _request_review_flow_success)
rustorecore.connect("rustore_request_review_flow_failure", _request_review_flow_failure)
-- Initialisation of rustorereview
end
function _request_review_flow_success(self, channel, value)
end
function _request_review_flow_failure(self, channel, value)
local data = json.decode(value)
end
rustorereview.request_review_flow()
The rustore_request_review_flow_failure callback returns a JSON string with error information. The error structure is described in Error Handling.
Triggering the in-app rating flow
To run the feedback form in your app, call thelaunch_review_flow() method using the previously obtained ReviewInfo.
You must subscribe to events once before using this method:
on_request_review_flow_success;on_request_review_flow_failure.
function init(self)
rustorecore.connect("rustore_launch_review_flow_success", _launch_review_flow_success)
rustorecore.connect("rustore_launch_review_flow_failure", _launch_review_flow_failure)
-- Initialisation of rustorereview
end
func _launch_review_flow_success(self, channel, value)
end
func _launch_review_flow_failure(self, channel, value)
local data = json.decode(value)
end
rustorereview.launch_review_flow()
rustore_launch_review_flow_success or rustore_launch_review_flow_failure to proceed with the application.
The rustore_launch_review_flow_failurecallback returns a JSON string with error information. The error structure is described in Error Handling.
success or failure), it is not recommended to display any additional forms related to assessment and feedback.
If called frequently, launch_review_flow() will not display the feedback window to the user, as the allowed display is regulated by RuStore.
Handling errors
The errors that occur can be retrieved in the events*_failure.
Error structure
function _on_failure(self, channel, value)
local data = json.decode(value)
local message = data.detailMessage
end
detailMessage– error description.
Error list
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.