AppOpenAdController
Configures and displays App Open ads. Mutable lifecycle state uses the injected main dispatcher.
It checks user preferences stored in AdsSettingsRepository to determine whether ads should be shown and manages the lifecycle of an AppOpenAd instance.
Constructors
Functions
Initializes the SDK once and publishes readiness. Ad loaders must wait for true; loading before initialization throws. The SDK initializes on IO, as Google asks for it to run off the main thread; the preference reads need no switch, since DataStore is main-safe.
Initializes ads from the host-manifest AdMobAppIdDataSource and observes the shared AdsSettingsRepository.adsEnabled, so enabling ads later can initialize the SDK without a process restart. Missing or invalid app IDs skip initialization; no fallback publisher ID is supplied.
Displays an ad if one has been loaded.