AdsSettingsRepository

The stored ad preferences: whether ads show at all, and whether App Open ads are reduced.

Reads fail with a StorageException from the flow, and writes throw one, when the preferences cannot be read or written. Every function is safe to call from the main thread.

Properties

Link copied to clipboard
abstract val adsEnabled: StateFlow<Boolean>

Shared enablement for SDK initialization and UI, false until storage answers.

Functions

Link copied to clipboard
abstract fun observeAdsEnabled(): Flow<Boolean>

Whether ads show, with the store's default until the person changes it.

Link copied to clipboard
abstract fun observeReduceAds(): Flow<Boolean>

Whether App Open ads are suppressed.

Link copied to clipboard
abstract suspend fun setAdsEnabled(enabled: Boolean)
Link copied to clipboard
abstract suspend fun setReduceAds(enabled: Boolean)