Skip to main content

google_admob_sdk 1.0.3 copy "google_admob_sdk: ^1.0.3" to clipboard
google_admob_sdk: ^1.0.3 copied to clipboard

A self-managed, high-speed Flutter plugin for Google Mobile Ads Next-Gen SDK & 3rd-Party Ad Networks (AppLovin, Meta, Mintegral, Unity Ads, Pangle, IronSource, Liftoff) with centralized Ad Unit ID man [...]

1.0.3 #

  • Revenue & Analytics Fixes:

    • Waterfall Preserved After Every Show: Auto-reload after a fullscreen show now repeats the original loadAd (original customAdUnitId, AdRequest, screenName, adUnitName, A/B test params) instead of pinning the unit that just served, so the next load starts again from the high-floor unit. The resolved network of the shown ad is no longer reused as a sticky adNetwork override.
    • Splash & ParallelAdPoolManager Analytics: Pool loads log ad_request + health monitor stats; pool shows log revenue (onPaidEvent), iaa_fail_show, clicks and ad_complete. Each SharedAdUnitSlot has its own AdRetryPolicy, reset when connectivity returns.
    • Firebase Reserved Names: FirebaseAdLogger no longer sends the reserved ad_click event (click data goes to iaa_click) and skips reserved event names and firebase_ / google_ / ga_ user properties instead of throwing.
    • iOS Consent Status Mapping: getConsentStatus maps UMP values explicitly to the Dart ConsentStatus order (iOS orders required before notRequired); builds without UMP return unknown instead of obtained.
    • Failed Shows: The frequency-capping cooldown starts only in onAdShowedFullScreenContent. A failed or throwing show() disposes the ad, resets the showing flags, logs iaa_fail_show and reloads; PlatformException on show is reported through onAdFailedToShowFullScreenContent.
    • Enforced Backoff (AdRetryPolicy.loadBlockedError): After a failed waterfall, loadAd is refused for the backoff window (2s, 4s, 8s... up to 60s; 3-minute circuit breaker after 5 failures) and offline loads are refused too, all reported through onAdFailedToLoad instead of silently returning false.
  • Policy & Compliance:

    • COPPA & Meta ATT Propagation (Android & iOS): MediationConfig.isChildDirected is forwarded to Meta (setMixedAudience), Vungle (setCOPPAStatus), Mintegral, Unity (setNonBehavioral) and IronSource/LevelPlay (is_child_directed), and mirrored into AdMob tagForChildDirectedTreatment unless the RequestConfiguration sets it. metaAdvertiserTrackingEnabled reaches FBAdSettings on iOS. setThirdPartyPrivacyConsent replies only after the flags are applied.
    • Native Privacy Fixes: iOS now applies privacy flags at init (Dart sends mediationConfig, Swift read mediationPrivacy). Each 3rd-party setter runs independently, so missing APIs (Pangle 8.x setGDPRConsent) no longer abort a network's remaining flags. IronSource uses LevelPlay (mediation SDK 9.x); Unity uses UnityAds.setUserConsent / setUserOptOut / setNonBehavioral (4.20+), with MetaData as fallback.
    • Consent Gate (GoogleAdmobSdk.instance.canRequestAds): requestConsentIfRequired stores the UMP result; while it is false every load fails with LoadAdError.consentRequired without a network request or a counted retry failure. The consent-info request times out after infoUpdateTimeout (10s) so the splash never hangs offline; showPrivacyOptionsForm refreshes the gate.
    • Click-Safe Layouts: The NativeAdWidget close button moved to a 32px strip outside the ad view (never over assets, CTA or AdChoices; closeButtonAlignment defaults to topRight). Fullscreen variants 2, 8 and 10 now close through the template Close button and keep a top close icon. The tallMediaProgressClose progress bar follows the real countdown instead of a fixed 45%.
    • No Impressions Under the Shimmer: eagerSurfaceMount now defaults to false for NativeAdWidget and BannerAdWidget; when enabled, minShimmerDuration is ignored.
    • Release Logging & PII: ConsoleAdLogger.useDeviceLog defaults to !kReleaseMode; initialize(enableLogging:, enableDeviceLog:) default to off in release (an onLog callback still receives logs). AnalyticsUserProperties.userName / userEmail are deprecated and skipped by FirebaseAdLogger, which also redacts e-mail addresses (and phone numbers in search/feedback text).
    • No Silent Test Ads in Release (AdIdConfig.allowTestAdUnitIds): Defaults to !kReleaseMode. In release builds a missing or Google test ad unit ID resolves to '' and the load fails with LoadAdError.missingAdUnitId plus a one-time warning. AdIdConfig.test() keeps test IDs allowed.
  • Lifecycle & Leak Fixes:

    • Reused Ads: NativeAdWidget / BannerAdWidget restore the ad's previous listener when they let go of it and ignore callbacks for ads they no longer show, so disposed widgets stop receiving onPaidEvent / onAdClicked (no duplicated revenue).
    • Superseded Banner Requests: A banner request replaced by a hedged fallback or pool rescue can no longer touch timers, start a fallback or replace the ad on screen.
    • Pools: NativeAdPool.set / BannerAdPool.set release the ad they replace; NativeAdPool forgets key mappings when ads leave the keyed pool; BannerAdPool.clear(), disposeAd() and releaseOrRescueKeyedAd() complete pending waiters (no widget stuck on shimmer). Widgets dispose ads they loaded themselves even when a preloadedAd was given (the caller still owns preloadedAd).
    • Disposed Ads: load() after dispose() no longer reaches native, and show() on a disposed ad reports onAdFailedToShowFullScreenContent.
    • Countdown Dialog: showAdSafely and NativeAdInterstitialDialog close only their own route (dismissOwnRoute) instead of popping the user's screen.
    • Fullscreen Watchdog (AdInstanceManager): A show that never reports back fails after fullScreenShowTimeout (10s); a lost dismiss is reported after fullScreenMaxOnScreen (5 min), or fullScreenResumeGrace (3s) after the app resumes on Android. Late native events are dropped, so isAnyFullScreenAdShowing and the splash race always recover.
    • Shared Interstitial Cooldown (GoogleAdmobSdk.instance.lastInterstitialShowTime): Every InterstitialAdManager (including forUnitKey) and ParallelAdPoolManager check the same cooldown; resetCooldown() clears it.
    • Banner Resizing: Adaptive banners are re-requested after rotation / split-screen resize (300ms debounce) and when adUnitId, size or collapsible placement change (didUpdateWidget).
    • Debug Crash: NativeAdWidget(borderRadius:) without decoration no longer asserts.
    • Slow-Network Detection: isSlowNetwork needs slowLoadsBeforeFastTrack (2) consecutive slow loads or a network error within slowNetworkWindow (60s); any fast response ends it, so high-floor units are no longer skipped after a single slow load.
  • Architecture & Maintenance:

    • FullScreenAdManager<T>: InterstitialAdManager, RewardedAdManager, RewardedInterstitialAdManager and AppOpenAdManager now share one implementation (rewarded formats via the RewardedFullScreenAd mixin); public APIs are unchanged. Fixes the waterfall skipping its first fallback on slow networks. isAdAvailable / isAdLoaded are side-effect free.
    • Global Ads Switch (GoogleAdmobSdk.instance.adsEnabled / adsEnabledListenable): For premium users or a Remote Config kill switch. While false, loads fail with LoadAdError.adsDisabled, fullscreen ads and splash races are skipped, and ad widgets render nothing; mounted widgets load again when re-enabled.
    • Deprecations: setUserControlledAppMuted (use setAppMuted), setApplicationVolume (use setAppVolume) and GoogleAdmobSdk.instance.health (use healthMonitor).
    • File Layout: NativeAdPool, BannerAdPool, FigmaNativeAdPreview and the Firebase / Console / Composite loggers moved to part files; AdCountdownConfig / AdCountdownDialog moved to ad_countdown_dialog.dart (still exported).
    • MediationConfig.copyWith: setPrivacyConsent no longer drops enableHedgedParallelFallback. Unused fields (enableTestMode, credentials, networkExtras, preloadBiddingSignals) are documented as reserved.
    • Docs: AGENTS.md and README.md corrected (consent-first quickstart, enforced backoff, 55-minute TTL, slow-network rules, eagerSurfaceMount, ads switch).
    • Tests: Added p0_fixes_test.dart, p0_policy_test.dart, p1_lifecycle_test.dart and p2_architecture_test.dart (147 tests in total).
  • Build Fixes:

    • Added the 9 drawables used by admob_native_cctv_horizontal.xml, admob_native_cctv_medium.xml and admob_native_full.xml (admob_rounded_card_cctv, ic_ad_info, ...), fixing :google_admob_sdk:verifyReleaseResources in release builds.
  • Migration Notes:

    • Call GoogleAdmobSdk.requestConsentIfRequired() before GoogleAdmobSdk.initialize().
    • Release builds need real ad unit IDs for every format they use (or AdIdConfig.test() / allowTestAdUnitIds: true for internal builds).
    • Pass enableLogging: true to keep console logs in release.
    • showCloseButton / closeNativeShowBanner add a 32px strip to the native widget height.
    • Adaptive banners make an extra request on each rotation.

1.0.2 #

  • Banner Creative Snug-Fitting & Letterbox Elimination (BannerAdWidget / BannerAdWidget.adaptive):
    • AdMob WebView Background Normalization:
      • Automatically clears AdMob WebView's <body style="background-color:#000000"> black letterbox background to transparent, preventing black bars when adaptive slots are taller than the creative.
      • Re-aligns internal #google-center-div to vertical-align: top so banner creatives flush snugly against the top edge and align with the "Test Ad" badge.
    • Rendered Creative Height Auto-Detection (syncBannerWebViewCreativeBounds):
      • Injected lightweight JavaScript evaluator into s41 (gmaWebView) to probe #google_image_div / rendered image bounds and fire onAdSizeChanged to shrink BannerAdWidget to the exact rendered creative height (e.g. 53dp for scaled 468x60 ads in a 411x64 adaptive slot).
    • Platform View Container Protection (AdPlatformContainerFrameLayout):
      • Created custom AdPlatformContainerFrameLayout container on Android that measures AdView with MeasureSpec.UNSPECIFIED while clipping to the exact rendered creative height, completely preventing GMA Next-Gen SDK's "Not enough space to show ad" error.
  • Workspace & Package Cleanup:
    • Removed internal tracking spreadsheet from repository and package distribution.
    • Synchronized all developer rules and workflow skills in .agents/rules and .agents/skills with v1.0.2 architecture and standards.

1.0.1 #

  • Dynamic / Intrinsic Height Auto-Resizing (height == null) without Ad Reloading:
    • Native Ad Intrinsic Height Auto-Adjustment (NativeAdWidget):
      • Changed height to default to null across NativeAdWidget and all named preset constructors (.small, .medium, .fromPreset, .normal, .nativeViewSmall, .medium01, .nativeView, .figmaMedium, .mediaView, .mediaViewTopCta, .mediaViewSplitCenter, .mediaViewSplitRight, .mediaViewLarge, .big, .cls, .interstitial, .dark).
      • When height == null, the widget automatically resizes to the exact measured intrinsic height of the native ad (platformAdHeight / loadedHeight) without triggering an ad reload.
      • When an explicit height is provided (height != null), the widget strictly respects the caller's specified height.
      • Added onAdSizeChanged listener callback to AdWithViewListener and NativeAdListener.
      • Synchronized layout rebinding (rebindLayout) and swapPlatformViewAd to notify Flutter of newly measured dimensions and update SizedBox dimensions in-place.
    • Banner Ad Dynamic Height Auto-Adjustment (BannerAdWidget):
      • Added optional width and height parameters (null by default) to BannerAdWidget and BannerAdWidget.adaptive.
      • When height == null, the container dynamically resizes to the loaded platformAdSize without reloading the ad.
      • Updated BannerAdWidget.adaptive and BannerAdPool to request standard 'anchoredAdaptive' (AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize) instead of 'largeAnchoredAdaptive', matching Google's official adaptive height formula (~50dp–64dp on phones) and preventing oversized ~128dp slots with black bars above and below 60dp creatives.
      • Added measureBannerAdViewIntrinsic, resolveBannerLoadedSizeDp, syncBannerWebViewCreativeBounds, and AdPlatformContainerFrameLayout in GoogleAdmobSdkPlugin.kt to query BannerAd.getAdSize(), clear AdMob WebView's <body style="background-color:#000000"> letterbox background, align #google-center-div to vertical-align: top, and resize BannerAdWidget to the exact rendered #google_image_div creative height (53dp for scaled 468x60 inside 411x64) without triggering "Not enough space to show ad".
      • Added onAdSizeChanged callback to BannerAdListener and wired size change notifications on initial load, adaptive re-measurements, and auto-refreshes (onAdRefreshed).
    • Elimination of Excess Blank Space & Layout Measurement Hardening:
      • Android (GoogleAdmobSdkPlugin.kt):
        • Added measureNativeAdViewIntrinsic to compute the true intrinsic content height via MeasureSpec.UNSPECIFIED (temporarily constraining internal SDK AdChoices overlay views to WRAP_CONTENT during measurement).
        • Added createContainerLayoutParamsForAdView using WRAP_CONTENT height for inline NativeAdView and AdView (instead of MATCH_PARENT), completely eliminating unwanted blank white space beneath native ad cards.
        • Fixed pre-mounted container squashing for BannerAd: banners (~90dp) now measure with MeasureSpec.UNSPECIFIED height instead of being clipped to the initial shimmer container height (~69dp).
        • Attached containerLayoutListeners (OnLayoutChangeListener) to dynamically report onAdSizeChanged events to Flutter whenever container dimensions change.
      • iOS (GoogleAdmobSdkPlugin.swift):
        • Added intrinsic height calculation for Figma presets, returning loadedWidth and loadedHeight in nativeMetadata and onAdLoaded.
        • Added native handler for rebindNativeAdLayout and updated swapPlatformViewAd to emit onAdSizeChanged.
    • Build & Gradle Duplicate Class Fixes:
      • Resolved :app:checkDebugDuplicateClasses build failure caused by duplicate com.google.android.gms.ads.* classes between Next-Gen SDK ads-mobile-sdk:1.6.0 and transitive play-services-ads-api:25.5.0 via explicit Gradle exclude rules in android/build.gradle.kts and example/android/app/build.gradle.kts.

1.0.0 #

  • Google Mobile Ads (GMA) Next-Gen SDK (com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.6.0) Migration & Compliance Hardening:
    • GMA Next-Gen SDK Native Engine:
      • Migrated Android native runtime from legacy com.google.android.gms:play-services-ads to com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.6.0 and com.google.android.ump:user-messaging-platform:4.0.0.
      • Added InitializationConfig, format-specific AdRequest classes (BannerAdRequest, NativeAdRequest, AppOpenAdRequest), BannerAd.isCollapsible(), MobileAds.setUserControlledAppMuted(...), and Next-Gen Preloader APIs (InterstitialAdPreloader, RewardedAdPreloader, RewardedInterstitialAdPreloader, AppOpenAdPreloader).
      • Upgraded all 7 bundled mediation adapters to their latest Next-Gen compatible artifacts (applovin:13.6.4.2, facebook:6.22.0.1, mintegral:17.1.81.1, unity:4.21.0.0, pangle:8.3.0.4.0, ironsource:9.6.1.0, vungle:7.7.8.1) with scoped exclusion of legacy play-services-ads.
      • Updated all built-in XML Native layouts (admob_native_cls.xml, admob_native_mediaview.xml, admob_native_mediaview_bottom_cta.xml, admob_native_interstitial.xml, admob_native_small.xml) to com.google.android.libraries.ads.mobile.sdk.nativead.NativeAdView, MediaView, and AdChoicesView.
    • UMP "Privacy Options" (GDPR) Compliance (Android & iOS):
      • Added ConsentInformation.instance.getPrivacyOptionsRequirementStatus(), ConsentInformation.instance.isPrivacyOptionsRequired(), ConsentForm.showPrivacyOptionsForm(...), and GoogleAdmobSdk.showPrivacyOptionsForm().
      • Implemented getPrivacyOptionsRequirementStatus and showPrivacyOptionsForm on both Android (UserMessagingPlatform.showPrivacyOptionsForm) and iOS (ConsentForm.presentPrivacyOptionsForm).
    • Consent-Safe Boot Warm-Up & Strict InitializationConfig Handling:
      • Removed premature MobileAds.initialize from AdmobFastBootProvider so process boot only warms up Chromium WebView, DNS cache, and XML ViewPools without starting the AdMob SDK or 3rd-party mediation adapters before UMP consent.
      • Added release-build validation in resolveAdMobAppId to fail fast with a clear MISSING_APP_ID error if com.google.android.gms.ads.APPLICATION_ID is omitted in release builds.
      • Added Meta Audience Network CCPA Limited Data Use (AdSettings.setDataProcessingOptions(["LDU"], 0, 0)) and structured warning logs in applyThirdPartyPrivacyConsent.
    • Next-Gen Adaptive Banner AdSize APIs:
      • Tagged adaptive AdSize instances with sizeType ('anchoredAdaptive', 'largeAnchoredAdaptive', 'inlineAdaptive', 'fluid'), orientation, and maxHeight.
      • Resolved native AdSize on Android and iOS using AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize, AdSize.getLargeAnchoredAdaptiveBannerAdSize, and AdSize.getInlineAdaptiveBannerAdSize, returning resolved dimensions via BannerAd.platformAdSize.
    • Zero-Leak In-Flight Ad Disposal & Main-Thread UI Safety:
      • Tracked disposedAdIds and disposeGeneration in native Android & iOS so in-flight ads that finish loading after disposeAd(adId) are immediately destroyed (ad.destroy()) and never leaked in memory.
      • Enforced runOnMainThread across all View/MethodChannel callbacks invoked from GMA Next-Gen SDK's background Publisher Callback threads.

0.1.0 #

  • Complete Figma Native (23 Presets) & Native Fullscreen + Video (12 Variants) Catalog + 0.0ms Frame #1 Rendering Engine:
    • 23 Built-in Figma NativeTemplatePreset Layouts:
      • Added full support and named constructors on NativeAdWidget and AdmobNativeStyles for all Figma Native designs: small (100dp), normal (132dp, 57:964), nativeViewSmall (136dp, 57:1032), medium01 (182dp, 57:977), nativeView (203dp, 57:1013), medium / figmaMedium (272dp, 57:992), mediaView (272dp, 57:1049), mediaViewTopCta (272dp, 57:1069), mediaViewSplitCenter (272dp, 57:1089), mediaViewSplitRight (272dp, 57:1109), mediaViewLarge (272dp, 57:1129), big (282dp, 57:1149), cls (282dp, 57:1167), clsOrange (282dp, 57:1185), interstitial (380dp, 70:6181), dark (272dp), plus 7 fullscreen layout presets.
    • 12 Built-in Figma NativeFullScreenVariant (Fullscreen & Video) Layouts:
      • Added NativeFullScreenVariant (classicCard, tallMediaStackedButtons, headerTopTallMedia, tallMediaArrowNext, immersiveVideo, segmentedArrowNext, segmentedClose, segmentedSplitButtons, tallMediaProgressClose, blurredCardStackedButtons, segmentedClassicCard, segmentedFloatingCta) matching Figma nodes 57:1203 – 57:1540.
      • Added embeddable NativeFullScreenAdWidget (with 12 named constructors) and upgraded showNativeAdInterstitialDialog + NativeAdInterstitialDialog.warmUp(...).
    • 0.0ms Frame #1 Dual-Layer Instant Render & 0ms Hot-Swap (Android & iOS Parity):
      • Implemented FigmaNativeAdPreview in ad_core.dart rendering all 23 Figma presets in 0.0ms on Frame #1 on both Android and iOS using NativeAdMetadata (headline, body, callToAction, advertiser, starRating, iconBytes, imageUri, mediaAspectRatio, hasVideoContent).
      • Upgraded GoogleAdmobSdkPlugin.kt (Android) and GoogleAdmobSdkPlugin.swift (iOS) with pre-inflated/pre-bound NativeAdView / GADNativeAdView builders, Eager Surface Pre-Mounting (containerId = -widgetId), and 0ms swapPlatformViewAd hot-swapping.
      • Added layout-accurate NativeAdShimmer (NativeShimmerLayout) skeletons for all 23 presets to ensure Zero Cumulative Layout Shift (Zero-CLS).

0.0.9 #

  • Advanced Revenue & Enterprise Monetization Optimizations:
    • Anchored Adaptive Banners (BannerAdWidget.adaptive):
      • Added BannerAdWidget.adaptive(...) factory and isAdaptive: true support to dynamically calculate optimal anchored banner height using AdSize.getLargeAnchoredAdaptiveBannerAdSize(...).
      • Eliminates letterboxing, side gutters, and vertical text clipping across modern devices and tablets.
    • High-eCPM Collapsible Banner Ads:
      • Added CollapsiblePlacement enum (none, bottom, top) and parameter to BannerAdWidget.
      • Automatically injects {'collapsible': 'bottom'|'top'} extras into AdRequest, rendering an expandable overlay on first load with a close toggle that yields 2x–4x higher eCPM compared to static banners.
    • Server-Side Verification (SSV) for Rewarded Ads:
      • Added ServerSideVerificationOptions support to RewardedAdManager and RewardedInterstitialAdManager.
      • Exposes setServerSideVerificationOptions(...) and serverSideVerificationOptions parameter in loadAd(...).
      • Google AdMob servers validate rewarded ad views through direct webhook callbacks to the backend, preventing client-side reward manipulation and virtual currency spoofing.
    • Automated Background-to-Foreground App Open Reactor (AppLifecycleReactor):
      • Implemented AppLifecycleReactor implementing WidgetsBindingObserver to manage background-to-foreground transitions.
      • Configurable minBackgroundDuration (default 15s) prevents annoying ad popups on rapid app switching or system permission dialogs.
      • Configurable minShowInterval (default 5 minutes) and custom canShowAd predicate (e.g. skip ads during checkout flows).
    • COPPA & Ad Content Rating Compliance in Initialization:
      • Added maxAdContentRating (MaxAdContentRating.g, pg, t, ma) and ageRestrictedTreatment (TagForChildDirectedTreatment.yes, no) in GoogleAdmobSdk.initialize.
      • Ensures compliance with Google Play Families Policy and EU GDPR-K.
    • Google UMP (User Messaging Platform) Consent Flow & Enterprise Tools:
      • Added GoogleAdmobSdk.requestConsentIfRequired(...) to automate IAB TCF v2.2 GDPR/UK consent management, preventing 100% No-Fill (Error Code 3) penalties in European markets.
      • Added GoogleAdmobSdk.openAdInspector(...) for real-time on-device mediation and bidding inspection.
      • Added GoogleAdmobSdk.setAppMuted(bool) and GoogleAdmobSdk.setAppVolume(double) for global video ad audio control.
    • Fullscreen Concurrency Guards & Ad Collision Prevention:
      • Added atomic isShowing state tracking across all fullscreen managers (InterstitialAdManager, RewardedAdManager, RewardedInterstitialAdManager, AppOpenAdManager).
      • Added global GoogleAdmobSdk.instance.isAnyFullScreenAdShowing and lastFullScreenAdDismissedTime state coordination.
      • Safely blocks rapid double-tap or simultaneous showAd / showAdSafely requests, eliminating native PlatformException: Ad already presented exceptions.
      • Protects AppLifecycleReactor by automatically suppressing App Open Ads immediately after closing Interstitial or Rewarded Ads.
    • In-Flight Request Deduplication & Multi-Caller Caching (Completer<bool>):
      • Implemented single-flight request deduplication across all 4 fullscreen managers (InterstitialAdManager, RewardedAdManager, RewardedInterstitialAdManager, AppOpenAdManager).
      • Concurrent loadAd() calls attach to the single active network request instead of triggering multiple duplicate requests or dropping calls with false.
      • Eliminates request spamming to Google AdMob servers and preserves high Match Rate (> 85-95%).
    • BannerAdPool & Multi-Widget Banner Caching:
      • Added BannerAdPool and cacheKey / preloadedAd properties to BannerAdWidget and BannerAdWidget.adaptive, matching NativeAdPool.
      • Allows caching and reusing banners across tabs and screen transitions without repeatedly requesting new banner ads.

0.0.8 #

  • Critical AdMob Metrics, Traffic Quality & Match/Show Rate Protection:
    • Ad Quality, Show Rate & Match Rate Protection Architecture:
      • Ad TTL & 60-Minute Expiration Auto-Invalidation:
        • Added maxAdAge (60 minutes for Interstitial, Rewarded, and Rewarded Interstitial; 4 hours for App Open) in accordance with Google AdMob policy.
        • Added isAdAvailable and loadTime getters across all managers.
        • Automatically invalidates and disposes expired ads to prevent displaying stale ads that cause invalid impressions and account-level policy penalties.
      • Exponential Backoff & Circuit Breaker (AdRetryPolicy):
        • Integrated AdRetryPolicy into all managers to prevent rapid request storms on ERROR_CODE_NO_FILL (Code 3) or network loss.
        • Implements backoff sequence (2s $\rightarrow$ 4s $\rightarrow$ 8s $\rightarrow$ 16s $\rightarrow$ 60s) and trips a Circuit Breaker when consecutive failures exceed the threshold, protecting Ad Unit Quality Score and Match Rates.
      • Smart Auto-Reload & Delay Capping:
        • Added GoogleAdmobSdk.instance.enableAutoReload and autoReloadDelay to eliminate orphan preloads (ads loaded upon dismissal that are abandoned when the user leaves the app).
      • Realtime Inventory Health Monitor (AdHealthMonitor):
        • Added AdHealthMonitor accessible via GoogleAdmobSdk.instance.healthMonitor (.health).
        • Computes realtime Match Rate, Show Rate, and CTR with automatic warnings when Show Rate $< 50%$ or consecutive No-Fill errors occur.
    • Frequency Capping & Safe Interstitial Flow:
      • Added InterstitialAdManager.shared singleton instance to retain preloaded interstitial ads across screens and lifecycle transitions.
      • Integrated Frequency Capping (minShowInterval, defaults to 180 seconds - 3 minutes) with canShow and remainingCooldown getters to prevent excessive CTR and accidental clicks (Invalid Traffic policy penalties).
      • Added showAdSafely(...) with configurable countdown notice dialog (AdCountdownDialog / showWarningCountdown), smoothly notifying users before fullscreen ad presentation.
      • Added AdCountdownConfig and exposed parameters countdownTitle, countdownSubtitle, and countdownConfig across InterstitialAdManager, RewardedAdManager, and RewardedInterstitialAdManager for custom styling and internationalization (i18n).
      • Enhanced showNativeAdInterstitialDialog with custom styling parameters (backgroundColor, height, showProgressBar, progressColor, closeButton, topBar, contentPadding).
      • Standardized all user-facing dialogs, examples, and internal doc comments to English.
    • Rewarded & Rewarded Interstitial Shared Singletons:
      • Added RewardedAdManager.shared and RewardedInterstitialAdManager.shared to resolve 0% Show Rate caused by orphan preloaded ads being disposed during screen navigation.
      • Added showAdSafely(...) to both rewarded managers.
    • App Open Ad Shared Singleton:
      • Added AppOpenAdManager.shared global instance for app open lifecycle handling.
    • Banner & Native Ad KeepAlive & State Retention:
      • Integrated AutomaticKeepAliveClientMixin (keepAlive: true by default) in both BannerAdWidget and NativeAdWidget to eliminate ad destruction and reload cycles during ListView/GridView/TabBarView scrolling and tab switches.
      • Added NativeAdPool cache pool (cacheKey) and preloadedAd support to reuse loaded native ads across feeds and tabs, resolving the 24–34 impressions/user spam issue.
    • Bidding & Mediation Troubleshooting (0.00% Bids Resolution):
      • Added Pangle (TikTok / ByteDance) mediation adapter setup for Android (com.google.ads.mediation:pangle:6.4.0.6.0) and iOS (GoogleMobileAdsMediationPangle).
      • Added comprehensive root-cause analysis and troubleshooting checklist in doc/MEDIATION_SETUP_GUIDE.md and README.md addressing why apps experience 0.00% bids when native adapters are omitted.

0.0.7 #

  • Native Ad Styles, Presets & Custom Layouts:
    • Added NativeTemplatePreset enum with clean preset names (mediaView, cls, interstitial, small, dark) matching modern design tokens, with deprecated figma* aliases for backward compatibility:
      • mediaView: Matches Figma node 70:6182 (Ads?Native_mediaview) with #1A90FF CTA, white background, 10px corner radius, and subtle typography.
      • cls: Matches Figma node 70:6183 (Ads/Native_cls) with CLS-optimized layout and palette.
      • interstitial: Matches Figma node 70:6181 (Ads Interstitial) with prominent 16px title, 14px body, and 10px rounded corners.
      • small: Compact small template using the modern design tokens.
      • dark: Dark mode theme (#1E1E1E background).
    • Added AdmobNativeStyles factory class with predefined factory methods (mediaView, cls, interstitial, small, dark, fromPreset, and custom) alongside deprecated figma* aliases.
    • Enhanced NativeAdWidget with templatePreset, decoration, margin, padding, and borderRadius properties. Gracefully defaults to mediaView when neither nativeTemplateStyle nor factoryId is supplied, preventing assertion errors out-of-the-box.
    • Added Custom Layout Support in NativeAdWidget:
      • layoutBuilder: Custom builder allowing developers to place the ad view anywhere in their custom widget hierarchy.
      • Integrated layout slots: header, footer, badge, badgeAlignment, showCloseButton, onClose, closeButtonAlignment, and aspectRatio.
      • Added customOptions map forwarding to NativeAd for custom platform factories.
    • Added showNativeAdInterstitialDialog and NativeAdInterstitialDialog reproducing the fullscreen Figma "Ads Interstitial" layout (Node 70:6181) with top bar indicator, close button, and Databuckets tracking.
    • Added complete native platform factory guide doc/CUSTOM_NATIVE_LAYOUTS.md with Android XML and iOS Swift templates.
    • Updated Example app with interactive Native Ad styles switcher (MediaView vs CLS) and fullscreen Native Interstitial Dialog demonstration.

0.0.6 #

  • Tag & Logging Enhancements:
    • Standardized bracketed tag [GoogleAdmobSdk] across all log outputs for easy search and filtering in Android Studio Logcat.
    • Added configurable logTag parameter (defaults to [GoogleAdmobSdk]) in GoogleAdmobSdk.initialize, with runtime getter GoogleAdmobSdk.instance.logTag and setter GoogleAdmobSdk.instance.setLogTag(String).
    • Added custom log interceptor callback onLog in GoogleAdmobSdk.initialize and runtime setter GoogleAdmobSdk.instance.setOnLog(callback).
    • Silenced repetitive uninitialized Firebase warning in FirebaseAdLogger when Firebase is not configured in the host app.
  • Dependency Compatibility:
    • Expanded dependency ranges: firebase_analytics: '>=12.4.6 <13.0.0' and firebase_core: '>=4.13.0 <5.0.0' for maximum compatibility across Flutter apps.

0.0.5 #

  • Device & Console Logging Enhancements:
    • Added enableDeviceLog and enableLogging flags in GoogleAdmobSdk.initialize to output formatted logs directly to Android Studio Logcat and iOS console across all build modes (Debug, Profile, and Release).
    • Added runtime logging toggle GoogleAdmobSdk.instance.setLoggingEnabled(bool).
    • Formatted output displaying detailed diagnostics for AdMob Load Success (format, unit ID, placement, load duration ms, network), Load Failure (error code, error message, duration), Impressions (with revenue value), Clicks, and Fullscreen Ad Completions.

0.0.4 #

  • Android Built-in Kotlin Migration:
    • Migrated plugin build configuration from external Kotlin Gradle Plugin (org.jetbrains.kotlin.android) to AGP Built-in Kotlin (id("com.android.library")), resolving Flutter KGP deprecation warnings.
    • Configured unified JVM target 17 across Java and Kotlin tasks (tasks.withType<KotlinCompile>).
  • Dependency Updates & Compatibility:
    • Updated and verified dependencies: google_mobile_ads: ^9.1.0, firebase_analytics: ^12.4.6, firebase_core: ^4.13.0, flutter_lints: ^6.0.0.
    • Re-exported firebase_core and firebase_analytics from the main barrel file for convenient access.
    • Made FirebaseAdLogger resilient with lazy initialization to prevent crashes when Firebase is not yet configured.
  • AI-Ready Context & Developer Documentation:
    • Added root AGENTS.md, workspace rules (.agents/rules/), and workflow skill (.agents/skills/google-admob-sdk-guide/).
    • Added comprehensive architecture, ad format, and Databuckets tracking documentation in doc/ (ARCHITECTURE.md, AD_FORMATS_GUIDE.md, DATABUCKETS_TRACKING.md, TESTING_AND_CONTRIBUTING.md).
  • Package Publishing & Quality:
    • Optimized .pubignore and .gitignore to keep published archive size ultra-compact (~267 KB).
    • Excluded build artifacts in analysis_options.yaml with 0 analysis issues and 100% test coverage.
    • Synchronized example project dependencies and configuration.

0.0.3 #

  • Fixed onPaidEvent setter error in BannerAdWidget and NativeAdWidget by passing onPaidEvent directly as a parameter in BannerAdListener and NativeAdListener.
  • Expanded logAdRequest with support for full Databuckets Sheet 41 parameters: ad_request_id, ad_unit_name, ad_mediation, screen_name, error_code, error_message, ad_mediation_ab_test_name, ad_mediation_ab_test_variant, session_number, ad_source_instance, ad_source_instance_id, ad_source, ad_source_id, media_format.
  • Added dual event firing for Sheet 41 Universal IAA events (iaa_request, iaa_loaded, iaa_fail_load, iaa_impression, iaa_fail_show, iaa_click, iaa_complete) alongside legacy ad_* events.
  • Updated all ad widgets (BannerAdWidget, NativeAdWidget) and ad managers (InterstitialAdManager, RewardedAdManager, RewardedInterstitialAdManager, AppOpenAdManager) to accept the new tracking parameters and automatically log them during ad load requests.
  • Fully verified and aligned all IAA tracking events with Technify <> Databuckets - 41.csv specification.

0.0.2 #

  • Added adKey parameter support across all ad widgets and managers, sending ad_key and type-specific key_<ad_type> parameters (key_banner, key_interstitial, key_rewarded, key_rewardedInterstitial, key_appOpen, key_native) to Firebase Analytics.
  • Added RewardedInterstitialAdManager for Rewarded Interstitial Ads with official Google test IDs.
  • Added NativeAdWidget for Native Ads with customizable NativeTemplateStyle and NativeAdOptions.
  • Added customizable progressIndicator property to BannerAdWidget and NativeAdWidget.
  • Added comprehensive unit test suite covering all configurations, loggers, and ad managers.

0.0.1 #

  • Initial release of google_admob_sdk.
  • Added GoogleAdmobSdk manager for centralized SDK initialization.
  • Added AdIdConfig for managing Android & iOS Ad Unit IDs with Google test IDs fallback.
  • Added AdAnalyticsLogger supporting FirebaseAdLogger and ConsoleAdLogger.
  • Added BannerAdWidget widget for automatic banner state management.
  • Added InterstitialAdManager, RewardedAdManager, and AppOpenAdManager.
0
likes
150
points
479
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A self-managed, high-speed Flutter plugin for Google Mobile Ads Next-Gen SDK & 3rd-Party Ad Networks (AppLovin, Meta, Mintegral, Unity Ads, Pangle, IronSource, Liftoff) with centralized Ad Unit ID management, waterfall fallback, and Databuckets analytics.

Repository (GitLab)
View/report issues

Topics

#ads #admob #mediation #monetization #analytics

License

MIT (license)

Dependencies

firebase_analytics, firebase_core, flutter

More

Packages that depend on google_admob_sdk

Packages that implement google_admob_sdk