跳到主要内容

评分和评论 SDK for Defold (版本 6.0.0)

一般

RuStore In-app 评论 SDK 鼓励用户评估您的应用程序并在 RuStore 上留下反馈,而无需离开应用程序。

评分和用户反馈场景可以随时在您的应用程序中的用户路径中运行。 用户可以从 1 到 5 评分您的应用程序,并留下反馈。

实施例子

查看 例例应用程序报告了解如何正确整合评论和评级SDK。

用户场景例子

img

什么时候要求在应用中评分和审查

使用下面的提示来决定什么时候要求用户评分并留下反馈: (参见下方)

  • 开始这个过程,一旦用户已经使用了您的应用程序很长一段时间。

  • 避免经常开始,因为这会损害您的应用程序的用户体验,并限制使用或SDK评分。

  • 避免使用“Rate App”按钮等行动呼叫,因为用户可能已经达到过程开始限制。

  • 您的应用程序不应该在启动之前或在运行过程中向用户提出任何问题,包括他们的意见(“您喜欢该应用程序吗?”)或预测问题(“您可以给该应用程序5星?”)。

设计建议

使用下面的提示来决定如何整合过程:

  • 显示过程如同,无干预或修改现有设计,包括尺寸,不透明度,形状和其他属性。

  • 不要在上方或进程的侧面添加任何东西。

  • 该过程应在所有层的顶部开放. 开始后不要关闭过程. 该过程在用户的明确行动后会自行关闭。

连接到项目

  1. 从官方 RuStore 存储库复制插件项目 GitFlic
  2. 将内容 review_example/extension_rustore_reviewreview_example/extension_rustore_core复制到您的项目的根文件夹中。

与用户评级合作

以用户评分开始

在呼叫图书馆方法之前,您必须启动图书馆。

Calling the init
function init(self)
rustorereview.init()
end

准备申请应用评级

Call request_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.
Listening for events
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
Calling the request_review_flow
rustorereview.request_review_flow()

rustore_request_review_flow_failure 通话回复将带有错误信息的 JSON 序列. 错误结构在 Error Handling中描述。

在应用中引导评级流

To run the feedback form in your app, call the launch_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.
Listening for events
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
Calling the launch_review_flow
rustorereview.launch_review_flow()
Await notification that the user has completed the form in rustore_launch_review_flow_success or rustore_launch_review_flow_failure to proceed with the application.

rustore_launch_review_flow_failurecallback 返回一个 JSON 行与错误信息. 错误结构在 Error Handling中描述。

After completing the feedback form, regardless of the outcome (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.

处理错误

发生的错误可以在事件 *_failure 中获取。

错误结构

Обработка json ошибки
function _on_failure(self, channel, value)
local data = json.decode(value)

local message = data.detailMessage
end
  • detailMessage – error description

错误列表

  • 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 with ReviewInfo;
  • RuStoreException — basic RuStore error from which other errors are inherited