Skip to main content

admob_flutter_plus 0.3.0 copy "admob_flutter_plus: ^0.3.0" to clipboard
admob_flutter_plus: ^0.3.0 copied to clipboard

PlatformAndroid

Community Flutter plugin for Google Mobile Ads Next-Gen SDK (Android): banners, interstitials, rewarded, native templates, picture-in-picture, preloaders, UMP, app open.

Changelog #

All notable changes to this project are documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.3.0 #

Changed #

  • Breaking: AdManager.reward, rewardInterstitial, showPreLoadedReward, and showPreLoadedRewardInterstitial now call onReward(bool isReward, RewardItem? reward) at dismiss. isReward is true with the AdMob item when the user earned the reward, or false with null when the ad was closed early. onClosed runs after onReward and is not a reward result.

0.2.2 #

Changed #

  • Native, banner, and preloaded banner slots use the placeholder until an ad is showing. With no placeholder, the slot is SizedBox.shrink(). Custom or template height applies only while an ad is on screen. Loading, no fill, and load errors do not keep that height.

0.2.1 #

Added #

  • AdManager.initialize onConsentDismissed. It runs when the consent form closes, or when no form was required. true means enabled preloaders and resume app-open load on their own. false means no ad request was sent.

Changed #

  • Preloaded interstitial, rewarded, and rewarded interstitial shows use the buffer only. An empty buffer calls onUnavailable and does not load again.
  • interstitial / reward / rewardInterstitial load once only when that unit's preloader is off or the caller uses a different ad unit.
  • Resume app-open shows a cached ad only while it is still filled. An expired ad is loaded again for the next resume and is not shown on that return. A failed load is not retried.
  • A preloaded banner no longer falls back to loadAd when the buffer is empty or register fails. It reports onAdFailedToLoad instead.
  • Preloaders and resume app-open start only when canRequestAds is true, including after setAdsEnabled(true). A consent error no longer counts as permission to request ads.

0.2.0 #

Added #

  • AdManager convenience helper (lib/src/manager/):
    • initialize — UMP consent (show if required), Mobile Ads init, optional preloaders via preAdUnitIds, optional resume app-open (never on cold start), adsEnabled kill-switch, test devices. Never throws.
    • Widgets: banner / showPreLoadedBanner / native (required NativeTemplate: .banner / .small / .large or NativeTemplate.asset(path)).
    • Load-and-show: interstitial / reward / rewardInterstitial (poll then load if needed).
    • Ready-prefer: showPreLoadedInterstitial / showPreLoadedReward / showPreLoadedRewardInterstitial (poll buffer; if empty, one load-then-show — no retry loop).
    • First-open showAppOpen(adUnitId:) and PiP showPopAd / hidePopAd.
  • BannerAdPreloader (start requires AdSize; isAvailable / count / destroy). BannerAdView.usePreload polls the buffer natively and falls back to loadAd when empty. AdManager preloadBanner + preloadBannerSize start that buffer; showPreLoadedBanner attaches with usePreload: true.
  • Dart sources reorganized under lib/src/sdk/ (public API names unchanged).

Changed #

  • AdManager.native takes a required template only; templateAsset was removed in favor of NativeTemplate.asset(path).

Clarified #

  • showAppOpen(adUnitId:) is always on-demand load-then-show, even when showAppOpenOnResume is false. Resume cache is separate and is not consumed by showAppOpen.

0.1.4 #

Added #

  • Picture-in-picture ads (GMA Next-Gen 1.4.0 open beta): PictureInPictureAd with load / show / hide / dispose, PictureInPictureAdOptions (position + presentation scope), and PictureInPictureAdListener (onAdShown / onAdHidden plus shared impression/click/fullscreen callbacks).
  • Example app PiP tab with Google test unit ca-app-pub-3940256099942544/9657123429.

Changed #

  • Android GMA Next-Gen dependency bumped to ads-mobile-sdk:1.4.0.

0.1.3 #

Added #

  • AdMob Mediation support for GMA Next-Gen: Gradle excludes for legacy play-services-ads / play-services-ads-lite, and MobileAds.initialize() now returns InitializationStatus with per-adapter AdapterStatus (AdapterInitializationState: complete, failed, initializing, notStarted, timedOut, plus isComplete) and description/latency. Documented Next-Gen adapter setup (Maven com.google.ads.mediation:* in the host app — not gma_mediation_* / google_mobile_ads).
  • RequestConfiguration.ageRestrictedTreatment (child / teen / unspecified) matching GMA Next-Gen setAgeRestrictedTreatment.
  • ConsentDebugGeography.other and regulatedUsState (UMP debug geography).
  • GMA Next-Gen 1.3.0 API surface:
    • MobileAds.initialize(disableSdkCrashReporting: …)
    • Ad.getAdUnitId() exposed as adUnitId on full-screen ads, NativeAd.resolvedAdUnitId, and BannerAdController.adUnitId
    • README docs for the DISABLE_AD_INSPECTOR manifest flag

Changed #

  • Android library deps bumped: GMA Next-Gen ads-mobile-sdk:1.3.0, lifecycle-process:2.11.0, kotlinx-coroutines-android:1.11.0 (UMP remains 4.0.0). Plugin AGP stays on Flutter-ecosystem 8.13.1 (not host AGP — apps keep their own Gradle/AGP).
  • Kotlin callbacks renamed to match AdMob SDK parameter names (silences named-argument warnings).

Deprecated #

  • TagForChildDirectedTreatment / TagForUnderAgeOfConsent — use AgeRestrictedTreatment.
  • ConsentDebugGeography.notEea — use ConsentDebugGeography.other.

Fixed #

  • Native template inflater: avoid deprecated scaledDensity and redundant MarginLayoutParams type check.

0.1.2 #

Added #

  • Custom native asset templates: support Android Space (and android.widget.Space) in XML inflated by NativeCustomAdView.

0.1.1 #

Fixed #

  • README screenshots on pub.dev: use absolute GitHub raw image URLs and a fixed width for banner/native device screenshots so images render correctly and take less vertical space.

0.1.0 #

Initial release. Android-only, built on the Google Mobile Ads Next-Gen SDK (ads-mobile-sdk:1.2.1).

Added #

  • Core: MobileAds.initialize, getVersion, openAdInspector, setRequestConfiguration, AdRequest, AdError types, and an adId-based callback channel.
  • Consent: UMP ConsentInformation and ConsentForm bridge.
  • App state: AppStateEventNotifier backed by ProcessLifecycleOwner.
  • Banner ads: BannerAdView, BannerAdController (refresh()), full AdSize surface. AdSize.anchored() maps to getLargeAnchoredAdaptiveBannerAdSize.
  • Collapsible banner support via AdRequest.extras.
  • Interstitial, rewarded, rewarded interstitial, and app open ads with a Future-first load API and auto-consuming full-screen lifecycle.
  • Preloaders for interstitial, rewarded, and rewarded interstitial ads (InterstitialAdPreloader, RewardedAdPreloader, RewardedInterstitialAdPreloader) — the formats documented by Google's Next-Gen preloading guides.
  • Native ads with three prebuilt templates (banner, small, large), styling, and Native Validator media deferral for the large template.
  • Native ads can use custom XML templates from Flutter assets via NativeCustomAdView (android:tag binding). Throws NativeTemplateException when the asset is missing or required tags are absent. Optional asset tags include advertiser, price, store, stars, and media.
  • Native ad NativeAdViewStyle.fontFamily (optional). When omitted, template widgets inherit the host app font from ThemeData / DefaultTextStyle.
  • Full example app exercising every ad type with Google test ad units.
  • Unit tests for AdSize, banner retry policy, request/config serialization.

Fixed #

  • Banner PlatformView dispose races (safe post-dispose callbacks) that could crash the host app when leaving a screen that still had banners loading.
  • Example app: replaced TabBarView with single-section navigation so AdMob PlatformViews are fully disposed before another section mounts.
  • Custom asset templates no longer call Android LayoutInflater on a raw XmlPullParser (which crashed with XmlPullAttributes cannot be cast to XmlBlock$Parser). Templates are inflated programmatically from the asset XML instead.
1
likes
150
points
171
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Community Flutter plugin for Google Mobile Ads Next-Gen SDK (Android): banners, interstitials, rewarded, native templates, picture-in-picture, preloaders, UMP, app open.

Repository (GitHub)
View/report issues
Contributing

Topics

#ads #admob #google-mobile-ads #android

License

MIT (license)

Dependencies

flutter

More

Packages that depend on admob_flutter_plus

Packages that implement admob_flutter_plus