AdsBootstrap class
Package-owned entry point for initializing the complete ads stack.
The host app only needs to provide adUnitIds, optional
AdsRemoteConfigOptions, and an optional premium-user callback. Mobile Ads
initialization, config fallback, handler creation, preload, and lifecycle
handling are managed by the package. When consent is omitted, debug
builds disable the UMP gate for test ads and release builds enforce UMP.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- consentManager → AdsConsentManager?
-
The UMP manager used during bootstrap, if consent integration was
explicitly enabled. In debug builds, omitted consent leaves this null;
release builds create it automatically.
no setter
- isInitialized → bool
-
Whether the package has completed initialization.
no setter
Static Methods
-
init(
{required AdsAdUnitIds adUnitIds, AdsRemoteConfigOptions? remoteConfig, int interstitialAfter = 3, bool isProUser()?, AdsConsentOptions? consent, AdsPolicyOptions? policy, bool? bannerEnabled, bool? interstitialEnabled, bool? nativeEnabled, bool? appOpenEnabled, bool? rewardedEnabled, bool? directInterstitialEnabled, bool adsEnabled = true, int maxRetryAttempts = 2, Duration retryBaseDelay = const Duration(seconds: 10), bool preloadEnabled = true, Duration connectivityRecheckInterval = const Duration(minutes: 3)}) → Future< AdsService> - Initialize the package once.
-
isPrivacyOptionsRequired(
) → Future< bool> - Whether Google requires a visible privacy-options entry point.
-
resolveConsentOptions(
{AdsConsentOptions? consent, bool debug = kDebugMode}) → AdsConsentOptions -
Resolves the environment-aware default used when
consentis omitted. -
showPrivacyOptions(
) → Future< bool> - Shows Google's privacy-options form and refreshes the ads gate.