簡體   English   中英

我可以在 Android 模擬器中測試 Google Play 應用內評論嗎?

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

我正在學習Google Play 應用內評論

我在 Android 模擬器中運行代碼 A,我希望像圖像 A 一樣顯示 Google 應用內評論 UI,但我只得到信息“aa”,這意味着請求失敗。

我可以在 Android 模擬器中測試 Google Play 應用內評論嗎?

代碼 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 在此處輸入圖像描述

是的,您可以通過模擬器測試應用內評論。 但必須需要在您的模擬器上安裝游戲商店。 並且必須登錄。

應用內評論僅適用於以下設備:

  1. 運行 Android 5.0(API 級別 21)或更高版本並安裝了 Google Play 商店的 Android 設備(手機和平板電腦)。
  2. 安裝了 Google Play 商店的 Chrome 操作系統設備。

並使用 -

val manager = FakeReviewManager(context)

您可以獲得有關此 url 的更多詳細信息 - 測試應用內評論

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM