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

Viewed 1472

I'm learning Google Play In-App Review .

I run Code A in Android Emulator, I hope to display Google in-app review UI just like Image A, but I get only the info "aa" which means request failed.

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

Code 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.
                }
     }

Image A enter image description here

0 Answers
Related