Google Play In-App Review API prompts users to rate your app without leaving. Higher completion rates than external reviews.
ReviewManager Setup
Initialize with Google Play Services:
val manager = ReviewManagerFactory.create(context)
val request = manager.requestReviewFlow()
request.addOnCompleteListener { task ->
if (task.isSuccessful) {
val reviewInfo = task.result
val flow = manager.launchReviewFlow(activity, reviewInfo)
flow.addOnCompleteListener {
// Review submitted or dismissed
}
}
}
Compose Integration
Trigger after key user actions:
@Composable
fun TaskCompletionScreen(activity: FragmentActivity) {
LaunchedEffect(Unit) {
// Request review after task completion
requestInAppReview(activity)
}
Column {
Text("Task completed successfully!")
}
}
suspend fun requestInAppReview(activity: FragmentActivity) {
val manager = ReviewManagerFactory.create(activity)
try {
val reviewInfo = suspendCancellableCoroutine { continuation ->
manager.requestReviewFlow().addOnCompleteListener { task ->
if (task.isSuccessful) {
continuation.resume(task.result)
} else {
continuation.resumeWithException(task.exception ?: Exception())
}
}
}
manager.launchReviewFlow(activity, reviewInfo)
} catch (e: Exception) {
Log.e("Review", "Failed", e)
}
}
Smart Timing Strategies
Request at optimal moments:
- After user completes key task (achievement, milestone)
- 3+ days since first install (not immediate)
- When app is in foreground (not during background operations)
- Max 3 times per app lifetime (across devices)
Avoid requesting:
- During onboarding (user hasn't tried features)
- During critical flows (payment, security setup)
- On every app launch
Example timing check:
val sharedPrefs = context.getSharedPreferences("review", Context.MODE_PRIVATE)
val lastReviewTime = sharedPrefs.getLong("last_review", 0L)
val daysSinceLastReview = (System.currentTimeMillis() - lastReviewTime) / (24 * 60 * 60 * 1000)
if (daysSinceLastReview > 30) {
requestInAppReview(activity)
sharedPrefs.edit().putLong("last_review", System.currentTimeMillis()).apply()
}
Pro tip: Monitor review completion metrics in Google Play Console to optimize timing.
8 production-ready Android app templates on Gumroad.
Browse templates → Gumroad
Top comments (0)