我可以在 Android 模拟器中测试 Google Play 应用内评论吗?

Can I test Google Play In-App Review in Android Emulator?

我正在学习 Google Play In-App Review .

我运行代码A在Android模拟器中,我希望显示Google应用内评论UI就像图像A一样,但我只得到信息"aa" 表示请求失败。

我可以在 Android 模拟器中测试 Google 播放应用内评论吗?

代码A

val manager = ReviewManagerFactory.create(mContext)
   
    val request = manager.requestReviewFlow()
   //val manager = FakeReviewManager(mContext)
 
    request.addOnCompleteListener { request ->
                if (request.isSuccessful) {
                    // We got the ReviewInfo object
                    val reviewInfo = request.result


                    val flow = manager.launchReviewFlow(mActivity, reviewInfo)
                    flow.addOnCompleteListener { _ ->
                        // The flow has finished. The API does not indicate whether the user
                        // reviewed or not, or even whether the review dialog was shown. Thus, no
                        // matter the result, we continue our app flow.
                        Log.e("my","cc")
                    }

                    Log.e("my","bb")

                } else {
                    Log.e("my","aa")
                    // There was some problem, continue regardless of the result.
                }
     }

图片 A

是的,您可以通过模拟器测试应用内评价。但必须需要在您的模拟器上安装 Play 商店。并且必须登录。

应用内评论仅适用于以下设备:

  1. Android 设备(手机和平板电脑)运行 Android 5.0(API 21 级)或安装了 Google Play 商店的更高版本。
  2. Chrome OS 设备安装了 Google Play 商店。

并使用 -

进行测试

val manager = FakeReviewManager(context)

您可以了解更多详情 url - Test in-app review