AdsPreferencesDataSource

Persisted ads preference.

adsEnabled is the value both the SDK initializer and the ad views must read; sampling the preference separately with a different default is what previously let views request ads the SDK had never been initialized for.

Inheritors

Properties

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

Shared ads preference. Disabled until storage answers and while its read is failing.

Link copied to clipboard
Link copied to clipboard
abstract val reduceAds: Flow<Boolean>

Emits whether App Open ads should be suppressed.

Functions

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

Emits the ads preference with a caller-supplied default.

Link copied to clipboard
abstract fun close()

Stops the sharing coroutine backing adsEnabled.

Link copied to clipboard
abstract suspend fun saveAds(isChecked: Boolean)
Link copied to clipboard
abstract suspend fun saveReduceAds(isChecked: Boolean)