Google 应用内评论 - Android 原生无法正常工作

问题描述 投票:0回答:1

我目前正在研究在应用程序内显示应用程序内评论弹出窗口以供用户评论的要求。不幸的是,我在显示应用程序内评论弹出窗口时遇到了困难。我已遵循以下链接中提供的指南

https://developer.android.com/guide/playcore/in-app-review/kotlin-java

为了提供更多上下文,我在下面添加了我使用过的代码片段:

private fun requestInAppReview() {
    val reviewManager = ReviewManagerFactory.create(this)
    val request = reviewManager.requestReviewFlow()

    request.addOnCompleteListener { requestInfo ->
        if (requestInfo.isSuccessful) {
            // The flow will be launched if the request is successful.
            val reviewInfo = requestInfo.result
            val flow = reviewManager.launchReviewFlow(this, reviewInfo)

            flow.addOnCompleteListener { _ ->
                // The review flow has finished.
                // You can log or perform actions after the review is completed.
            }
        } else {
            // There was a problem requesting the review flow.
            // You can log or handle the error accordingly.
        }
    }
}

我正在使用以下依赖项。

implementation("com.google.android.play:review:2.0.1")
implementation("com.google.android.play:review-ktx:2.0.1")

非常感谢您为解决此问题提供的任何帮助或指导。预先感谢您的时间和支持。

android kotlin android-studio google-play google-reviews
1个回答
0
投票

在应用程序上集成和测试 InAppReview 时,您应该考虑很多事情。

测试它的最佳方法是通过内部应用程序共享或内部测试,因为它没有任何配额。

您还可以使用框架的

FakeReviewManager
类。

此外,此处提到了一些已知问题和解决方案。请在测试时考虑它们。

希望有帮助

© www.soinside.com 2019 - 2024. All rights reserved.