ReviewTracker

class ReviewTracker(store: ReviewStateStore = InMemoryReviewStateStore(), config: ReviewGateConfig = ReviewGateConfig(), now: () -> Long = { Clock.System.now().toEpochMilliseconds() })

Drives the in-app review prompt from engagement signals. Records first-open + interaction counts, and prompts (via the platform AppReviewManager) only when ReviewEligibility is satisfied, then stamps the prompt time to enforce the cooldown.

Constructors

Link copied to clipboard
constructor(store: ReviewStateStore = InMemoryReviewStateStore(), config: ReviewGateConfig = ReviewGateConfig(), now: () -> Long = { Clock.System.now().toEpochMilliseconds() })

Functions

Link copied to clipboard
suspend fun markPrompted()

Stamps the last-prompt time so the cooldown starts, after a native prompt was shown.

Link copied to clipboard
Link copied to clipboard
suspend fun recordInteraction()
Link copied to clipboard
suspend fun shouldPrompt(): Boolean

Pure eligibility read for a caller-drawn native review sheet (no store SDK) — the caller shows its own UI when this is true, then calls markPrompted. Separate from tryPrompt (which drives the platform AppReviewManager) so an offline/demo build can present a native sheet instead.

Link copied to clipboard
suspend fun tryPrompt(manager: AppReviewManager): Boolean

Prompts for review if eligible; returns true iff a prompt was launched.