Browse Source

* fix InAppReviewManager

develop
Sergey Petrov 4 months ago
parent
commit
d2a9a72fb5
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      app/src/main/java/com/telex/review/InAppReviewManager.kt

+ 4
- 2
app/src/main/java/com/telex/review/InAppReviewManager.kt View File

@ -28,14 +28,16 @@ class InAppReviewManager constructor(
if (needRequestAppReview()) {
val reviewManager = ReviewManagerFactory.create(context)
val requestReviewFlow = reviewManager.requestReviewFlow()
AnalyticsHelper.logAppReviewRequested()
appData.putLastAppReviewRequestTime(System.currentTimeMillis())
requestReviewFlow.addOnCompleteListener { request ->
when {
request.isSuccessful -> {
activityReference.get()?.apply {
reviewManager.launchReviewFlow(this, request.result)
.addOnCompleteListener {
AnalyticsHelper.logAppReviewRequested()
appData.putLastAppReviewRequestTime(System.currentTimeMillis())
emitter.onComplete()
}.addOnFailureListener { emitter.tryOnError(it) }
} ?: emitter.onComplete()

Loading…
Cancel
Save