AdvertisingHostApi class

Constructors

AdvertisingHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
Constructor for AdvertisingHostApi. The binaryMessenger named argument is available for dependency injection. If it is left null, the default BinaryMessenger will be used which routes to the host platform.

Properties

hashCode → int
The hash code for this object.
no setterinherited
pigeonVar_binaryMessenger → BinaryMessenger?
final
pigeonVar_messageChannelSuffix → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAvailableAdSlots() → Future<List<AdSlot>>
getDebugSnapshot() → Future<DebugSnapshot>
Returns a snapshot of the SDK's current diagnostic state. Safe to call at any time, including before initialize or with audit mode disabled (some fields will just be empty).
initialize(String bundleName, String publisherCode) → Future<void>
loadBannerAd() → Future<void>
loadInterstitialAd(String position, String? pageType) → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAdInspector() → Future<void>
Opens Google's native Ad Inspector UI, a full on-device viewer for real ad requests/responses and the mediation waterfall. Requires this device to be a registered Google Mobile Ads test device (emulators/simulators are registered automatically; for a physical device, see setTestDeviceIds) — Google's SDK enforces this itself and reports it via the returned error.
setAuditModeEnabled(bool enabled) → Future<void>
Turns the SDK's audit/debug mode on or off. When enabled: banner and interstitial ad requests are swapped to Google's public test ad unit IDs (so real "Test Ad" creatives serve instead of production inventory), Prebid Server debug echo + verbose SDK logging are enabled, and getDebugSnapshot starts reflecting live state. Intended for QA/publisher diagnostics, not end users — gate access to it however your app already gates internal tooling.
setInterstitialAutoReloadEnabled(bool enabled) → Future<void>
Enables or disables automatically preloading the next interstitial ad after the current one is dismissed. Enabled by default.
setInterstitialReloadDelaySeconds(int seconds) → Future<void>
Sets the delay, in seconds, before the next interstitial ad is preloaded after dismissal. Defaults to 0 (reload immediately). Has no effect when auto-reload is disabled.
setTestDeviceIds(List<String> testDeviceIds) → Future<void>
Registers this device's Google Mobile Ads test-device ID(s), so it serves test ads and can open Ad Inspector. Not needed on emulators/simulators (auto-registered by Google). On a physical device, Google's SDK only reveals this device's ID by logging it to Logcat/Console the first time an ad request is made while unregistered — call this with that value once you have it.
showInterstitialAd() → Future<void>
toString() → String
A string representation of this object.
inherited
updateConsent(ConsentInfo consent) → Future<void>
Updates the SDK's consent state. Call this as soon as consent info is available, and again whenever it changes (e.g. after the user updates their choice in your CMP). Safe to call before or after initialize.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

pigeonChannelCodec → const MessageCodec<Object?>