unified_ads 1.1.0
unified_ads: ^1.1.0 copied to clipboard
One unified Dart API for banner, interstitial and rewarded ads across AdMob, Unity, AppLovin MAX, LevelPlay, Facebook Audience Network, Start.io and InMobi.
1.1.0 #
- New: interstitial pacing.
AdConfig.pacingtakes anAdPacingper full-screen format:minInterval(cooldown between shows),showEveryActions(show after every NUnifiedAds.recordAction()calls) andinitialDelay(no show right after the first init). It works alongsideFrequencyCap, andshow()fails withfrequencyCapped, naming the rule, without contacting the network. Also available aspacinginpubspec.yaml/ads_config.json(minIntervalSeconds,showEveryActions,initialDelaySeconds). - New: ad-free mode for Pro users.
UnifiedAds.setAdFree(bool, {blockRewarded}),isAdFree,isBlocked(format)andadFreeChanges. Banners collapse (and reload when ads come back), interstitial / app openload()/show()/preload()return the newAdErrorCode.adsBlocked, and cached ads of blocked formats are released. Rewarded formats stay available unlessblockRewardedis set. - New
UnifiedAds.recordAction()/actionCount, andFullScreenAd.canShow()(ready + not blocked + cap and pacing met, without side effects). FrequencyStoregainsreadActionCount/writeActionCount/readActionMark/writeActionMarkwith default bodies, so a persistent store can keep the action count across launches.- Migration note: an exhaustive
switchoverAdErrorCodeneeds a case foradsBlocked, and a store declared withimplements FrequencyStoremust add the four new methods (extendskeeps compiling). See the README's "Migration notes". - README restyled (✨ Features, 📖 Quick start, …), with a new "Pacing, frequency caps and ad-free" section.
- BREAKING (iOS): CocoaPods support is removed; iOS builds use Swift Package Manager only (the podspec is deleted). Requires Flutter >= 3.44 with SPM enabled and Xcode 26.2+. The deployment target is now set on the Runner target in Xcode. See the migration guide.
- The iOS ATT helper still weak-links
AppTrackingTransparency(now via a-weak_frameworklinker flag inPackage.swift, ⚠ to be confirmed by CI), so the plugin still loads on iOS 13. - The iOS privacy manifest (
PrivacyInfo.xcprivacy) is bundled as an SPM resource. - Constraints on the other unified_ads packages are now
^1.1.0. - Fix:
show()on a full-screen ad no longer waits forever when the network's SDK sends neither a "shown" nor a "failed to show" callback (seen with Unity Ads and AppLovin MAX on the iOS simulator). It now fails withAdErrorCode.timeoutafter the newAdConfig.showTimeout(default 15 s;showTimeoutMsinads_config.json). Additive, non-breaking. FakeAdNetworkAdapter.showDelay(testing).- README: the complete guide (configuration, API, getting IDs for every network, platform setup, consent and ATT, architecture, SDK status), re-verified against every vendor's current Android and iOS guide.
1.0.0 #
Initial release.
UnifiedAdsfacade:init/isInitialized/dispose, safe on re-init and hot restart;- a broadcast
eventsstream; - a pluggable
logger, silent by default.
RewardedInterstitialAd(withRewardedInterstitialCallback) andAppOpenAd, behind the same waterfall, cache, frequency caps and callbacks. Networks without the format are skipped (today: AdMob has both, AppLovin MAX has app open).InterstitialAdandRewardedAd:load()/show()/isReady, every callback, andservedBy(the network that served the ad).BannerAd+UnifiedBannerWidget:- platform-view banners in standard, adaptive and inline sizes;
- anchored or inline placement;
forceNetworkand collapse-on-failure.
- Waterfall across networks with per-network timeouts and automatic fallback. The preload cache refills after close. Frequency capping per format.
- Declarative config:
AdConfigLoader(ads_config.json, per-platform IDs, errors with a JSON path);dart run unified_ads:generate_configturns a pubspecunified_ads:section into that asset, with--set-exit-if-changedfor CI.
- Consent and ATT:
gatherConsent/updateConsentwith anyConsentProvider;requestTrackingAuthorization/trackingAuthorizationStatus(the iOS ATT helper; weak-linked).
package:unified_ads/testing.dart: a scriptableFakeAdNetworkAdapterfor app tests.- The app never crashes because of an ad: every failure is an
AdError/AdResult.