AdConfig class
Configuration for the ad management system.
Pass this to AdManager to configure ad unit IDs, retry behavior, frequency capping, and other options.
final config = AdConfig(
bannerId: AdUnitId(
android: 'ca-app-pub-xxxxx/banner-android',
ios: 'ca-app-pub-xxxxx/banner-ios',
),
interstitialId: AdUnitId(
android: 'ca-app-pub-xxxxx/interstitial-android',
ios: 'ca-app-pub-xxxxx/interstitial-ios',
),
frequencyCapSeconds: 120,
maxRetryCount: 3,
);
Constructors
-
AdConfig({required AdUnitId bannerId, AdUnitId? interstitialId, AdUnitId? rewardedId, AdUnitId? appOpenId, List<
String> testDeviceIds = const [], int frequencyCapSeconds = 60, int maxRetryCount = 3, int retryBaseDelayMs = 1000, int loadTimeoutSeconds = 30, bool skipColdStartAppOpen = true}) -
Creates an ad configuration.
const
Properties
- appOpenId → AdUnitId?
-
App-open ad unit ID. Pass
nullto disable app-open ads.final -
Banner ad unit ID (required).
final
- frequencyCapSeconds → int
-
Minimum interval between interstitial ad impressions, in seconds.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interstitialId → AdUnitId?
-
Interstitial ad unit ID. Pass
nullto disable interstitial ads.final - loadTimeoutSeconds → int
-
Timeout for a single ad load attempt, in seconds.
final
- maxRetryCount → int
-
Maximum number of retry attempts when an ad fails to load.
final
- retryBaseDelayMs → int
-
Base delay for exponential backoff retry, in milliseconds.
final
- rewardedId → AdUnitId?
-
Rewarded ad unit ID. Pass
nullto disable rewarded ads.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipColdStartAppOpen → bool
-
Whether to skip app-open ads on cold start (first launch).
final
-
testDeviceIds
→ List<
String> -
Test device IDs for on-device testing.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited