Open arslanaligamesgear opened 12 months ago
I've got the same error and no idea how to solve it..
Same issue on version com.google.android.play:review:2.0.1
with the following code:
suspend fun instantShow(activity: Activity): Boolean {
val result = load(activity)
if (result != InAppReviewState.LOADED) {
return false
}
show(activity)
return true
}
private suspend fun load(context: Context) = suspendCoroutine { cont ->
if (state != InAppReviewState.IDLE) {
Logger.debug(TAG, "load - not IDLE state, but is [$state]. Returning...")
cont.resume(state)
return@suspendCoroutine
}
state = InAppReviewState.LOADING
manager = ReviewManagerFactory.create(context).apply {
requestReviewFlow()
.addOnFailureListener { e ->
Logger.error("load", e)
state = InAppReviewState.IDLE
cont.resume(state)
}
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Logger.debug(TAG, "load - success")
reviewInfo = task.result
state = InAppReviewState.LOADED
cont.resume(state)
} else {
@ReviewErrorCode val reviewErrorCode = (task.exception as ReviewException).errorCode
Logger.warning(TAG, "load - error - $reviewErrorCode")
state = InAppReviewState.IDLE
cont.resume(state)
}
}
}
}
private suspend fun show(activity: Activity) = suspendCoroutine { cont ->
if (state != InAppReviewState.LOADED) {
Logger.debug(TAG, "show - not LOADED state, but is [$state]. Returning...")
cont.resume(state)
return@suspendCoroutine
}
state = InAppReviewState.SHOWING
manager!!.launchReviewFlow(activity, reviewInfo!!)
.addOnFailureListener { e ->
Logger.error("show", e)
state = InAppReviewState.IDLE
cont.resume(state)
}
.addOnCompleteListener { task ->
Logger.debug(TAG, "show - completed - isSuccessful = ${task.isSuccessful}")
if (!task.isSuccessful) {
@ReviewErrorCode val reviewErrorCode = (task.exception as ReviewException).errorCode
Logger.warning(TAG, "show - error - $reviewErrorCode")
}
state = InAppReviewState.IDLE
cont.resume(state)
}
}
Logs show the following:
[...error same as in the comment above....]
load - success
show - completed - isSuccessful = true
i am encountering some issue in unity In APP Review system, i imported, google core, google review packages, called the review dialog using this IEnumerator RequestReview() { _reviewManager = new ReviewManager(); var requestFlowOperation = _reviewManager.RequestReviewFlow(); yield return requestFlowOperation; if (requestFlowOperation.Error != ReviewErrorCode.NoError) { // Log error. For example, using requestFlowOperation.Error.ToString(). yield break; } _playReviewInfo = requestFlowOperation.GetResult(); var launchFlowOperation = _reviewManager.LaunchReviewFlow(_playReviewInfo); yield return launchFlowOperation; _playReviewInfo = null; // Reset the object if (launchFlowOperation.Error != ReviewErrorCode.NoError) { // Log error. For example, using requestFlowOperation.Error.ToString(). yield break; } // 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.
1.made the test user account added it in play console ,