DefaultReviewRepository

Data-layer implementation that coordinates persisted review metadata and Play review requests.

The repository dispatches its own work, so callers can invoke it from anywhere. launchReviewFlow puts a dialog in front of the activity it is given, so it runs on the main thread whatever dispatcher the caller is on; awaiting the Play task suspends rather than blocks, so nothing is held up by that. The availability check reads the package manager, which is binder IPC, so that one goes to IO.

Constructors

Link copied to clipboard
constructor(preferences: ReviewPreferencesDataSource, dispatchers: DispatcherProvider)

Functions

Link copied to clipboard
open override fun hasPromptedReview(): Flow<Boolean>
Link copied to clipboard
open suspend override fun incrementSessionCount()
Link copied to clipboard
open suspend override fun isReviewAvailable(activity: Activity): Boolean

Checks whether the in-app review flow can be requested.

Link copied to clipboard
open suspend override fun launchReview(activity: Activity): Boolean

Attempts to launch the in-app review flow.

Link copied to clipboard
open override fun sessionCount(): Flow<Int>
Link copied to clipboard
open suspend override fun setHasPromptedReview(value: Boolean)