teads_flutter 1.2.0
teads_flutter: ^1.2.0 copied to clipboard
Teads in-app ads for Flutter: Feed, Media, Banner, Interstitial and Recommendations placements over the native Teads iOS and Android SDKs.
Changelog #
1.2.0 #
Feed and Banner now follow the native SDKs (Android 6.2.3, iOS 6.2.2) much more closely, in events, URL params, privacy and click handling. Several changes may need action in your app: the Feed's default bottom padding, Feed and Banner no longer reserving space before the ad loads, renamed Feed event values, userId precedence, FeedPlacementBuilder, the Feed scrolling its own fullscreen card into place, and an Android page-wide touch-coordinate override. Where the two native SDKs disagree, each platform now follows its own.
Feed layout #
- Feed adds no space under its content by default.
FeedPlacementused to reserve 50 logical px below its content, which showed as a gap under widgets that serve a single card. Neither native SDK's Feed adds any, so the default is now 0. If your layout relied on the 50, passcontentBottomPadding: 50.FeedPlacement.bottomPaddingis deprecated and still compiles; stop reading it. - Feed takes no space until the page reports its content. It used to reserve 300 px while loading. On iOS the Feed takes no space until the ad fills and its height is known, and stays at 0 if the page reports no fill first. A no-fill after that keeps the height. On Android the Feed takes each height the page reports, before fill too, as native Android does, so it can take space before the ad is confirmed. Before fill it ignores a report that only repeats the hidden WebView's 300 px starting height, and a no-fill before fill collapses it to 0. A no-fill after fill keeps the height. The loading spinner is gone.
FeedPlacement.initialHeightis deprecated and no longer the slot height. A layout that relied on the 300 px placeholder will shift. maxHeightcaps the whole Feed slot. The slot is the WebView pluscontentBottomPadding. With the default padding of 0 nothing changes. With a padding, the padding stays visible and the WebView gives up that room, so the slot never exceedsmaxHeight.- Feed re-measures after a rotation or window resize.
Feed events (onEvent) #
- Height changes. Feed emits
TeadsAdEvent.heightUpdatedwithheight, the slot height in your layout, likeBannerPlacementandMediaPlacement: the page's height pluscontentBottomPadding, capped atmaxHeight. On Android the page's height is first truncated to whole px, as native Android does, soheightis a whole number there unless the padding or the cap is fractional. ChangingcontentBottomPaddingormaxHeighton a rebuild emits it too, once the page has reported a height. On Android it fires for every height the page reports, repeats included; on iOS only when the height changes. Readheightasnum. It is not emitted while a card is fullscreen. - Clicks. Feed emits
TeadsAdEvent.clickedfor a sponsored recommendation or a display ad andTeadsAdEvent.clickedOrganicfor an organic recommendation, each with itsurl.clickedis emitted when the plugin asks to open the URL, not when the browser finishes loading. Repeated clicks within one second count as one, and on iOS so does a second tap while an organic click is still being reported. On AndroidclickedOrganicfires whether or notonOrganicClickis set. On iOS it fires, andonOrganicClickis called, only after the click's tracking report succeeds, as native iOS does. viewedreplacesviewability. The page's viewability event now arrives asTeadsAdEvent.viewed, as on both native SDKs.TeadsAdEvent.viewabilityis deprecated; it still fires right aftervieweduntil it is removed.- Fill. On iOS the page's fill now arrives as
TeadsAdEvent.loaded(it wasready). On Android it staysready, withisFillEvent: truein its data, andreadyfires twice per ad, as on native Android. - No-fill.
TeadsAdEvent.failednow carriesreason: 'notFilled'(it was'no-fill') plus the page's own fields, anderrorCode: 3on iOS. On Android a pageerrorevent now also arrives asfailed. - Nothing before fill, little after no-fill. Lifecycle events and
heightUpdatedare no longer emitted before the ad's fill or no-fill; the latest height is delivered right after fill. After a no-fill only clicks are emitted. onUnsupportedis quieter. Unrecognised page events, page error messages and the Google ads card messages no longer reach it. They are logged at debug level instead, as both native SDKs drop them.
Feed clicks and fullscreen #
- Links tapped in an ad open outside the feed. http links and app deep links (App Store,
tel:, custom schemes) inside a display ad now open in the browser or their app and emitclicked, instead of loading inside the feed. Non-web click URLs open in their app instead of failing. On Android,intent://links open only if an app claims the scheme. - On iOS the page is told about display-ad clicks and Google ads cards, as native iOS tells it.
- Fullscreen cards. On Android, back while a card is fullscreen closes the card instead of leaving the screen. Leaving fullscreen scrolls the enclosing list the way native does. On Android, fullscreen sets a transparent status bar and a black navigation bar and restores them afterwards. A bar your app's style gives no colour is left alone, so leaving fullscreen no longer leaves the navigation bar black in apps whose
AppBarsets none. When your style sets an icon brightness to restore, both bars also get light icons, so the clock and battery stay readable over the black card; native Android changes only the colours. On Android, viewability keeps reporting the feed's pre-fullscreen size and position while a card is fullscreen, as native does. On iOS, viewability and load-more pause while a card is fullscreen. On iOS the fullscreen card is sized to the whole screen, as native sends it, so hide your own app bar ononFullScreenChangeor the bottom of the card is cut off. - The Feed scrolls its fullscreen card to the top itself, in every host. On entering fullscreen it moves every enclosing scrollable so the card's top meets the viewport's, and repeats once a frame while the layout settles, for up to 10 frames. This replaces any scrolling your
onFullScreenChangedoes, so a header you keep visible above the card is scrolled away; fold your chrome into the callback instead, and drop any jump tomaxScrollExtent. In a lazy list (ListView.builder, aNestedScrollViewbody) such a jump used to leave the card partly off screen with black below it, because the list does not re-measure the items above the feed when they collapse. On exit the Feed restores only the nearest enclosing scrollable, so in aNestedScrollViewthe outer offset keeps what the entry gave it. - A pinned
SliverAppBarneeds three toggles while fullscreen. Setprimary: false,toolbarHeight: 0andtitle: nullwhile fullscreen, and back again after, asFeedNestedScrollScreenin the example does. A primary app bar keeps the status bar's height even at a zero toolbar height, and the card cannot scroll past it, butprimary: falseall the time puts your content under the status bar. Keep the bar in the tree: removing it re-parents the Feed's WebView, which stops it painting. - On Android, swiping between fullscreen cards keeps its direction. A swipe up sometimes went back to the previous card, or left fullscreen, on cards further down the feed. The fix changes what the page sees: from the first fullscreen on,
Touch.screenXandscreenYreturnclientXandclientYfor every script on the page, creatives and carousels included, and keep doing so after fullscreen ends. Those values are measured from the WebView's own viewport, not from the screen. - The server's horizontal-swipe setting is honoured, so carousels in the feed can scroll sideways.
- A Feed that fails to start collapses and logs the error type, instead of showing "Feed unavailable: ..." to users.
- A dark mode change made while the Feed loads is applied once the page is up.
- iOS long-press link previews are off, as native sets them. Android's WebView now honours the page's viewport, which disables pinch-zoom as on native.
Feed requests, privacy and tracking #
userIdfollows each native's rule. On iOS nouserIdis sent until App Tracking Transparency is authorized; after that a non-emptyFeedPlacementConfig.userIdwins over the IDFA. On Android the device advertising id wins unless ad tracking is limited, anduserIdis the fallback. The advertising id is read as the native Feed reads it, with no Huawei OAID fallback. It is read separately from the consent strings, so a slow advertising id read costs that request itsuserIdand never its consent strings.- Android
pubImpIddefaults to the widget ID, as native Android sends it. iOS still sends none. SetpubImpIdto send the same value on both. - On Android, the IAB TCF v1 consent string is sent whenever it is stored, even when no CMP is marked present, as native Android does.
- On iOS,
TeadsSdk.setTestMode(true)makes the Feed request test events, as native iOS does. - Device params match native.
networkis nownone,wifi,2g,3g,4gorunknown, plus5gon iOS (it wascellularorethernet). The Feed no longer sends a made-upcountry=US. On Android a value the device cannot give, such ascarrierwith no SIM, goes out empty, as native Android sends it; iOS omits params it cannot fill. Androiddeviceincludes the manufacturer, and tablets are detected as native does. iOSvhandvware the whole screen, and iOSappNameis the bundle name. Android sizes,densityand the user agent are formatted as native formats them. Params go out in each native's order. - On Android,
floorPriceis sent for any value, 0 included, as native Android does. iOS still sends only positive values. - The organic click report goes through the platform's HTTP stack, so it honours the device's HTTP proxy and shows up in tools such as Charles.
- New
FeedPlacementController.reportPageViewOnTheSameWidget(), to count a new page view on a Feed the user came back to, as native iOS offers. It does nothing on Android, which has no equivalent.
Banner #
BannerPlacementtakes no space until the ad fills and collapses to 0 on a no-fill or timeout, as native does.BannerPlacement.initialHeightis deprecated and no longer used. A layout that relied on the 100 px placeholder will shift.- New
BannerPlacementConfigfields.extId,extSecondaryId,obPubImpandfloorPriceare passed to the native Banner on both platforms. BannerPlacementConfig.testDisplayworks on iOS only. The native Android Banner ignores it, and the published Android SDK offers no other way to set it.- On iOS the Banner re-measures itself on rotation; forwarding
viewWillTransitionis no longer needed. - Banner and Media event data keep nested values, such as the page data on a fill, instead of only top-level strings and numbers.
Config and test doubles #
- New
FeedPlacementConfigfields.extId(sent asextid),extSecondaryId(extid2),floorPrice(pbf, anint) andtestDisplay, which forces a test creative as native does. They match the native Feed configs, andcopyWithaccepts them. FeedPlacementBuilderhas a new parameter. A custom builder passed toFeedPlacementBuilder(the test seam described in the integration guide) must now acceptcontentBottomPadding.FeedPlacement.newandMockFeedPlacement.newalready do.MockFeedPlacementfollows the real widget. It is 0 tall until a simulated fill, emitsclickedOrganicfromfireOrganicClick, drops event names the real widget drops instead of callingonUnsupported, and emitsviewedthenviewabilityfor the page's viewability event. Widget tests that checked its 300 px size or anonUnsupportedcall need updating. NewMockFeedPlacementControllerfor the new controller.
Fixes #
- The Feed counted its bottom padding twice. The WebView took the padding into its own height as well as getting it below, so the page measured the extra room as content and reported a larger height each time. On iOS this grew the Feed well past its content. The WebView now takes exactly the reported height, and the padding sits only below it.
- A throwing
onEvent,onFullScreenChangeoronUnsupportedno longer drops the rest of a Feed bridge message. Previously it could lose the shared bridge params and leave everywidgetIndexother than0Feed on the page blank. The error is reported throughFlutterError.onError. The same holds for a throwingonEventon the ad's fill: the held height is still delivered after it, where an iOS Feed used to stay at 0. A throwing Banner or Media callback no longer stops the slot from resizing either, which matters now that Banner starts at 0. - Docs: the organic-click fallback opens an in-app browser view. The doc comments said "external browser". The behaviour is unchanged since 1.0.0.
1.1.0 #
- iOS: Swift Package Manager support. The plugin is now also a Swift package (
ios/teads_flutter/Package.swift), resolvingTeadsSDK6.2.2 fromhttps://github.com/teads/TeadsSDK-iOS. Apps without Teads AdMob mediation keep working on either install path. Upgrading with AdMob mediation: an app that haspod 'TeadsAdMobAdapter'fails to build once Flutter 3.44+ builds the plugin through Swift Package Manager ("Multiple commands produce TeadsSDK.framework"), because the pod embedsTeadsSDKa second time. Take theTeadsAdMobAdapterproduct of theTeadsSDK-iOSpackage instead and callTeadsAdMobMediation.register()inAppDelegate, or turn Swift Package Manager off for the app; see the README. - Dependencies:
battery_plus7,connectivity_plus7,device_info_plus13 andpackage_info_plus10. - Android: no Teads Maven repository to add. The plugin now registers it on the app's root build. Apps that declare repositories centrally in
settings.gradle(dependencyResolutionManagement) still add it there, since Gradle ignores plugin-contributed repositories in that mode. - Android: no AdMob
APPLICATION_IDmanifest entry needed unless the app uses AdMob itself. Android SDK 6.2.2+ depends only onplay-services-ads-identifier, no longer onplay-services-ads, whose start-up provider crashed without an ID (verified 2026-09-28: a fresh app on 6.2.3 with no ID launches and configures). Earlier README versions asked for it; this was already true of 1.0.0. - Android: the plugin builds with AGP 8.12.1 (was 8.11.1), the version the upgraded dependencies declare. It is not a new floor for apps: a consuming app on AGP 8.11.1 was verified to still build (2026-09-28).
1.0.0 #
- Initial production release supporting Teads in-app ad formats.
- Feed: Pure-Dart SmartFeed placement hosting the recommendations bridge with custom viewability calculation.
- Media: Native InRead platform-view placement (
MediaPlacement) with dynamic aspect-ratio sizing and video opportunity tracking. - Banner: Native wrapped banner placement (
BannerPlacement) with dark mode support. - Interstitial: Fullscreen interstitial placement (
InterstitialPlacement) with preload-and-show lifecycle. - Recommendations: Native data fetch and click tracking for publisher-rendered recommendation feeds, the AdChoices URL, forced paid items for testing (
setTestRtb, withTeadsSdk.setTestMode), plus custom viewability reporting. - AdMob Mediation: Reference mediation integration and demo screens for Banner, Interstitial, and Media.