-
public final class EloAdOne ad ready to render.
An
EloAdis a showing, not a creative. The same creative can win repeatedly for the same user, and each win is a separate ad opportunity with its own tracking. id is that opportunity and is what impression dedup and analytics correlate on; creativeId is the artwork it happened to serve.The tracker is set by the winning adapter and owns render / impression telemetry plus click lifecycle behavior. Elo-direct clicks currently notify the publisher locally without a client-side click POST. The SDK never reads network-specific fields directly — it calls tracker methods.
The optional renderer is set by adapters whose underlying SDK requires view registration to count impressions and clicks (AdMob, Meta). When present, the SDK's Compose ad views embed the renderer's view via
AndroidView { ... }instead of rendering Elo-styled chrome.clickUrl is exposed (still
internal) for the view layer to launch the destination in a browser viaIntent.ACTION_VIEW.Mirrors iOS
EloAd.
-
-
Constructor Summary
Constructors Constructor Description EloAd(String id, String creativeId, String title, String description, String imageUrl, String clickUrl, AdTracker tracker, AdRenderer renderer, Function0<Unit> onRelease)Binary-compatibility shim for adapters built against 0.3. EloAd(String id, String creativeId, String title, String description, String imageUrl, String ctaText, String clickUrl, AdTracker tracker, AdRenderer renderer, Function0<Unit> onRelease)
-
Method Summary
Modifier and Type Method Description final StringgetId()The ad opportunity this showing belongs to (ad response request_id).final StringgetCreativeId()The creative that filled this opportunity (ad response ad_id).final StringgetTitle()final StringgetDescription()final StringgetImageUrl()final StringgetCtaText()Call-to-action label supplied by the creative (ad response cta_text), e.g.final EloAdcopy(String id, String creativeId, String title, String description, String imageUrl, String clickUrl, AdTracker tracker, AdRenderer renderer, Function0<Unit> onRelease)Binary-compatibility shim; see the secondary constructor above. final UnitreleaseResources()Release adapter-owned resources tied to this ad. final Unitrelease()Renamed for iOS parity — use releaseResources. -
-
Method Detail
-
getId
final String getId()
The ad opportunity this showing belongs to (ad response
request_id).Render, impression, and click URLs are keyed under this id server-side, so it is what correlates a confirmed impression to its funnel row and what render/impression dedup keys on. Carried through to the impression diagnostics entry (EloTrackingDiagnosticsEntry.serverRequestId).
Adapter authors: this must be unique per fill, not per creative. Networks exposing their own per-response id should pass it; those that don't should mint one. Mirrors iOS
EloAd.id.
-
getCreativeId
final String getCreativeId()
The creative that filled this opportunity (ad response
ad_id).Stable across opportunities — the same creative is served to the same user many times. Use it to recognize a creative, never to identify a showing, which is id. Deduping on this instead silenced every showing of a creative after the first, so those opportunities recorded a click with no render and no impression (ENG-375), and suppressed a repeat creative's thumbnail after one failed image load (ENG-397). Mirrors iOS
EloAd.creativeId.
-
getDescription
final String getDescription()
-
getImageUrl
final String getImageUrl()
-
getCtaText
final String getCtaText()
Call-to-action label supplied by the creative (ad response
cta_text), e.g."Learn more". When non-blank both layouts draw it as a pill in the trailing slot instead of the disclosure chevron; on the inline banner that pill is also the only click target. Mirrors iOSEloAd.ctaText.
-
copy
@Deprecated(message = Binary-compatibility shim for pre-0.4.0 adapters., level = DeprecationLevel.HIDDEN) final EloAd copy(String id, String creativeId, String title, String description, String imageUrl, String clickUrl, AdTracker tracker, AdRenderer renderer, Function0<Unit> onRelease)
Binary-compatibility shim; see the secondary constructor above.
copyis generated from the primary constructor, so its descriptor moved too.
-
releaseResources
final Unit releaseResources()
Release adapter-owned resources tied to this ad. Call this only when you've decided not to render the ad — e.g. you ran a client-side auction against another SDK and chose the other bid, so the EloAd you received from
Elo.loadAdwill never reach anEloAdView.For adapter-rendered fills (AdMob native, Meta, etc.) the underlying network's SDK holds native resources (e.g. AdMob's
NativeAd) that get released here. For Elo-direct fills this is a no-op. Safe to call more than once.Do not call this on an ad you've passed to
EloAdVieworElo.trackRender— the SDK manages losing-bid cleanup automatically (ParallelAuctionMediatorreleases all losing bids before returning the winner), and the view layer keeps the winner alive as long as it's displayed.Named for parity with iOS
EloAd.releaseResources().
-
release
@Deprecated(message = Renamed to releaseResources() for cross-platform parity., replaceWith = @ReplaceWith(imports = {}, expression = releaseResources())) final Unit release()
Renamed for iOS parity — use releaseResources.
-
-
-
-