评分和评论 SDK for Kotlin/Java (版本 6.0.0)
RuStore In-app 评论 SDK 鼓励用户评估您的应用程序并在 RuStore 上留下反馈,而无需离开应用程序。
评分和用户反馈场景可以随时在您的应用程序中的用户路径中运行。 用户可以从 1 到 5 评分您的应用程序,并留下反馈。
用户场景例子
什么时候要求在应用中评分和审查
使用下面的提示来决定什么时候要求用户评分并留下反馈: (参见下方)
-
开始这个过程,一旦用户已经使用了您的应用程序很长一段时间。
-
避免经常开始,因为这会损害您的应用程序的用户体验,并限制使用或SDK评分。
-
避免使用“Rate App”按钮等行动呼叫,因为用户可能已经达到过程开始限制。
-
您的应用程序不应该在启动之前或在运行过程中向用户提出任何问题,包括他们的意见(“您喜欢该应用程序吗?”)或预测问题(“您可以给该应用程序5星?”)。
设计建议
使用下面的提示来决定如何整合过程:
-
显示过程如同,无干预或修改现有设计,包括尺寸,不透明度,形状和其他属性。
-
不要在上方或进程的侧面添加任何东西。
-
该过程应在所有层的顶部开放. 开始后不要关闭过程. 该过程在用户的明确行动后会自行关闭。
连接到项目
- Kotlin
- Java
最少支持的 Kotlin 版本为 1.8
连接存储库(参见下方)。
repositories {
maven {
url = uri("https://artifactory-external.vkpartner.ru/artifactory/maven")
}
将下列代码添加到您的配置文件中,以注入依赖性:
- BOM
- Direct connection
使用 BOM 文件为配置的好处。
-
统一版本管理:
- 使用 BOM,您可以从一个文件 中管理所有依赖的版本,这特别有用,当您使用多家必须互相兼容的图书馆时。
- 例如,如果您有多个 RuStore 图书馆,如
ru.rustore.sdk:billingclient和ru.rustore.sdk:pushclient,您可以使用 BOM 确保它们都互相兼容。
-
更容易更新:
- 更新依赖性更容易,因为你只需要在一个地方更改版本号 - 在BOM文件中,这降低了缺乏依赖性更新的风险,并有助于避免版本冲突。
- 例如,如果新版本的BOM文件包含所有图书馆的更新版本,您只需要更新BOM文件,而不是每个依赖。
-
增强兼容性:
- 使用BOM可以避免不同图书馆之间的版本冲突,这特别重要,当图书馆相互依赖时。
- 例如,如果两个图书馆依赖同一图书馆的不同版本,这可能会导致冲突。
dependencies {
implementation(platform("ru.rustore.sdk:bom:6.0.0"))
implementation("ru.rustore.sdk:review")
}
dependencies {
implementation("ru.rustore.sdk:review:6.0.0")
}
连接存储库(参见下方)。
repositories {
maven {
url "https://artifactory-external.vkpartner.ru/artifactory/maven"
}
将下列代码添加到您的配置文件中,以注入依赖性:
- BOM
- Direct connection
使用 BOM 文件为配置的好处。
-
统一版本管理:
- 使用 BOM,您可以从一个文件中管理所有依赖的版本,这特别有用,当您使用多家必须互相兼容的图书馆时。
- 例如,如果您有多个 RuStore 图书馆,如
ru.rustore.sdk:billingclient和ru.rustore.sdk:pushclient,您可以使用 BOM 确保它们都互相兼容。
-
更容易更新:
- 更新依赖性更容易,因为你只需要在一个地方更改版本号 - 在BOM文件中,这降低了缺乏依赖性更新的风险,并有助于避免版本冲突。
- 例如,如果新版本的BOM文件包含所有图书馆的更新版本,您只需要更新BOM文件,而不是每个依赖。
-
增强兼容性:
- 使用BOM可以避免不同图书馆之间的版本冲突,这特别重要,当图书馆相互依赖时。
- 例如,如果两个图书馆依赖同一图书馆的不同版本,这可能会导致冲突。
dependencies {
implementation platform("ru.rustore.sdk:bom:6.0.0")
implementation "ru.rustore.sdk:review"
}
dependencies {
implementation "ru.rustore.sdk:review:6.0.0"
}
与用户评级合作
以用户评分开始
- Kotlin
- Java
To work with reviews, you need to create RuStoreReviewManager using RuStoreReviewManagerFactory.
val manager = RuStoreReviewManagerFactory.create(context)
To work with reviews, you need to create RuStoreReviewManager using RuStoreReviewManagerFactory.
RuStoreReviewManager manager = RuStoreReviewManagerFactory.INSTANCE.create(context);
准备申请应用评级
- Kotlin
- Java
launchReviewFlow 之前,请提前调用 requestReviewFlow,以准备显示所需的信息。ReviewInfo 的有效期约为五分钟。
manager.requestReviewFlow()
.addOnSuccessListener { reviewInfo ->
// Save reviewInfo
}
.addOnFailureListener { throwable ->
// Handling error
}
- 如果
onSuccess报告,回复被收到,请将 ReviewInfo 保存到本地,以便随后拨打LaunchReviewFlow报告。 - 如果收到
onFailure报告,则不建议向用户显示错误,因为用户没有启动此过程。
requestReviewFlow in advance before calling launchReviewFlow, to prepare necessary information to display. ReviewInfo has a lifetime — about five minutes.
manager.requestReviewFlow()
.addOnSuccessListener(reviewInfo -> {
// Save reviewInfo
})
.addOnFailureListener(throwable -> {
// Handling error
});
- 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.
在应用中引导评级流
- Kotlin
- Java
launchReviewFlow(reviewInfo) method using the previously obtained ReviewInfo.
manager.launchReviewFlow(reviewInfo)
.addOnSuccessListener {
// Review flow has finished, continue your app flow.
}
.addOnFailureListener { throwable ->
// Review flow has finished, continue your app flow.
}
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.
launchReviewFlow(reviewInfo) method using the previously obtained ReviewInfo.
manager.launchReviewFlow(reviewInfo)
.addOnSuccessListener(unit -> {
// Review flow has finished, continue your app flow.
})
.addOnFailureListener(throwable -> {
// Review flow has finished, continue your app flow.
});
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.