-
public class EloThe entry point for the Elo SDK.
Configure once early in your app lifecycle (typically
Application.onCreate), then call loadAd from anywhere to fetch a contextual ad based on the surrounding chat history.class MyApp : Application() { override fun onCreate() { super.onCreate() Elo.configure( context = this, publisherId = "YOUR_PUBLISHER_ID", adUnitId = "YOUR_AD_UNIT_ID", ) } }For mediation adapters and other options, use the configure overload that takes a full EloConfiguration.
Mirrors
iOS Sources/EloAds/Elo.swift.
-
-
Field Summary
Fields Modifier and Type Field Description private final static StringsdkVersionprivate final static BooleanisDisabledpublic final static EloINSTANCE
-
Method Summary
Modifier and Type Method Description final static Unitinitialize(Context context, String publisherId, String adUnitId, Boolean coppa, Boolean tfua)Initialize the SDK. final static Unitinitialize(Context context, String publisherId, String adUnitId, Boolean coppa)Initialize the SDK. final static Unitinitialize(Context context, String publisherId, String adUnitId)Initialize the SDK. final static Unitconfigure(Context context, String publisherId, String adUnitId, Boolean shareGeoLocation, Integer geoLocationPrecision)Configure the SDK with Elo demand only. final static Unitconfigure(Context context, String publisherId, String adUnitId, Boolean shareGeoLocation)Configure the SDK with Elo demand only. final static Unitconfigure(Context context, String publisherId, String adUnitId)Configure the SDK with Elo demand only. final static Unitconfigure(Context context, EloConfiguration configuration)Configure the SDK. final static Unitdisable()Pause new ad requests without tearing down the SDK. final static Unitenable()Re-enable ad requests after a previous disable. final static UnitsetListener(EloAdListener listener)Register a listener for ad lifecycle callbacks. final static UnitsetShareGeoLocation(Boolean enabled)Enable or disable Prebid-style passive geo sharing for future ad requests without reconfiguring the SDK. final static UnitsetRequestPayloadCaptureEnabled(Boolean enabled)Enable capture of each ad operation's redacted Elo request payload into diagnostics (EloDiagnosticsEntry. final static AdResultloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects, AdDisplayPosition displayPosition)Load an ad for the given chat context. final static AdResultloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects)Load an ad for the given chat context. final static AdResultloadAd(List<ChatMessage> messages)Load an ad for the given chat context. final static UnitpreloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects, AdDisplayPosition displayPosition)Warm the in-memory ad cache for the given chat context. final static UnitpreloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects)Warm the in-memory ad cache for the given chat context. final static UnitpreloadAd(List<ChatMessage> messages)Warm the in-memory ad cache for the given chat context. final static UnittrackRender(EloAd ad)Manual render-time hook for fully-custom views. final static UnittrackImpression(EloAd ad)Manual impression hook for fully-custom views. final static UnittrackClick(EloAd ad)Manual click hook for fully-custom views. final static EloMediationDebugSnapshotmediationDebugSnapshot()A read-only snapshot of adapter and auction state for debugging. final static EloDiagnosticsSnapshotdiagnosticsSnapshot()A read-only snapshot of integration health, recent ad operations, and recent tracking outcomes. final static Unitshutdown()Tear down the SDK. final static StringgetSdkVersion()final static BooleangetIsDisabled()-
-
Method Detail
-
initialize
@Deprecated(message = Use Elo.configure(context, publisherId, adUnitId) instead; for COPPA/TFUA build an EloConfiguration and call Elo.configure(context, configuration).)@JvmOverloads() final static Unit initialize(Context context, String publisherId, String adUnitId, Boolean coppa, Boolean tfua)
Initialize the SDK.
Deprecated sugar over configure. Use the
configure(context, publisherId, adUnitId, ...)convenience for the simple Elo-only case, or build an EloConfiguration and callconfigure(context, configuration)for everything else (mediation adapters, COPPA/TFUA,logLevel,baseUrl).
-
initialize
@Deprecated(message = Use Elo.configure(context, publisherId, adUnitId) instead; for COPPA/TFUA build an EloConfiguration and call Elo.configure(context, configuration).)@JvmOverloads() final static Unit initialize(Context context, String publisherId, String adUnitId, Boolean coppa)
Initialize the SDK.
Deprecated sugar over configure. Use the
configure(context, publisherId, adUnitId, ...)convenience for the simple Elo-only case, or build an EloConfiguration and callconfigure(context, configuration)for everything else (mediation adapters, COPPA/TFUA,logLevel,baseUrl).
-
initialize
@Deprecated(message = Use Elo.configure(context, publisherId, adUnitId) instead; for COPPA/TFUA build an EloConfiguration and call Elo.configure(context, configuration).)@JvmOverloads() final static Unit initialize(Context context, String publisherId, String adUnitId)
Initialize the SDK.
Deprecated sugar over configure. Use the
configure(context, publisherId, adUnitId, ...)convenience for the simple Elo-only case, or build an EloConfiguration and callconfigure(context, configuration)for everything else (mediation adapters, COPPA/TFUA,logLevel,baseUrl).
-
configure
@JvmOverloads() final static Unit configure(Context context, String publisherId, String adUnitId, Boolean shareGeoLocation, Integer geoLocationPrecision)
Configure the SDK with Elo demand only.
Convenience overload of configure for the common case — no mediation adapters, default options.
The geo-sharing controls are mirrored here (unlike every other option) because passive geo sharing is on by default and the opt-out should be visible at the simplest entry point. Anything else (mediation adapters, COPPA/TFUA flags, log level) is deliberately not mirrored — build an EloConfiguration and call
configure(context, configuration)instead.
-
configure
@JvmOverloads() final static Unit configure(Context context, String publisherId, String adUnitId, Boolean shareGeoLocation)
Configure the SDK with Elo demand only.
Convenience overload of configure for the common case — no mediation adapters, default options.
The geo-sharing controls are mirrored here (unlike every other option) because passive geo sharing is on by default and the opt-out should be visible at the simplest entry point. Anything else (mediation adapters, COPPA/TFUA flags, log level) is deliberately not mirrored — build an EloConfiguration and call
configure(context, configuration)instead.
-
configure
@JvmOverloads() final static Unit configure(Context context, String publisherId, String adUnitId)
Configure the SDK with Elo demand only.
Convenience overload of configure for the common case — no mediation adapters, default options.
The geo-sharing controls are mirrored here (unlike every other option) because passive geo sharing is on by default and the opt-out should be visible at the simplest entry point. Anything else (mediation adapters, COPPA/TFUA flags, log level) is deliberately not mirrored — build an EloConfiguration and call
configure(context, configuration)instead.
-
configure
final static Unit configure(Context context, EloConfiguration configuration)
Configure the SDK.
Call this once, early in your app's lifecycle. Subsequent calls re-configure and reset the session ID; in-flight
loadAdcalls are unaffected. All options — including client-side mediation adapters — live on EloConfiguration; every field except EloConfiguration.elo has a sensible default.
-
setListener
final static Unit setListener(EloAdListener listener)
Register a listener for ad lifecycle callbacks. SDK holds it weakly.
-
setShareGeoLocation
final static Unit setShareGeoLocation(Boolean enabled)
Enable or disable Prebid-style passive geo sharing for future ad requests without reconfiguring the SDK.
When enabled, the SDK may attach an already-authorized last-known location as OpenRTB
device.geo. It never requests location permission itself — with no location permission granted, geo is simply omitted.Sharing is on by default since 0.1.8. This runtime toggle does not survive shutdown: a later configure restores the configuration's value (default on), so apps that opt out at runtime must opt out again after reconfiguring. Prefer
EloConfiguration.shareGeoLocation = falsefor a durable opt-out.
-
setRequestPayloadCaptureEnabled
final static Unit setRequestPayloadCaptureEnabled(Boolean enabled)
Enable capture of each ad operation's redacted Elo request payload into diagnostics (EloDiagnosticsEntry.requestPayloadJson).
Off by default. Message content is always dropped, but the captured payload retains the advertising id, precise geolocation, and consent strings so privacy contracts stay inspectable. Enable it only in development/debug builds, and never log or transmit the captured payload off the device.
This is a process-level switch: it is independent of configure and shutdown, so set it once (e.g. at app startup). Mirrors iOS
Elo.setRequestPayloadCaptureEnabled.
-
loadAd
@JvmOverloads() final static AdResult loadAd(List<ChatMessage> messages, List<ContextObject> contextObjects, AdDisplayPosition displayPosition)
Load an ad for the given chat context.
-
loadAd
@JvmOverloads() final static AdResult loadAd(List<ChatMessage> messages, List<ContextObject> contextObjects)
Load an ad for the given chat context.
-
loadAd
@JvmOverloads() final static AdResult loadAd(List<ChatMessage> messages)
Load an ad for the given chat context.
-
preloadAd
@JvmOverloads() final static Unit preloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects, AdDisplayPosition displayPosition)
Warm the in-memory ad cache for the given chat context. Fire-and-forget.
-
preloadAd
@JvmOverloads() final static Unit preloadAd(List<ChatMessage> messages, List<ContextObject> contextObjects)
Warm the in-memory ad cache for the given chat context. Fire-and-forget.
-
preloadAd
@JvmOverloads() final static Unit preloadAd(List<ChatMessage> messages)
Warm the in-memory ad cache for the given chat context. Fire-and-forget.
-
trackRender
final static Unit trackRender(EloAd ad)
Manual render-time hook for fully-custom views.
-
trackImpression
final static Unit trackImpression(EloAd ad)
Manual impression hook for fully-custom views.
-
trackClick
final static Unit trackClick(EloAd ad)
Manual click hook for fully-custom views.
-
mediationDebugSnapshot
final static EloMediationDebugSnapshot mediationDebugSnapshot()
A read-only snapshot of adapter and auction state for debugging. Not a stable analytics pipeline. Phase 1 returns an empty snapshot.
-
diagnosticsSnapshot
final static EloDiagnosticsSnapshot diagnosticsSnapshot()
A read-only snapshot of integration health, recent ad operations, and recent tracking outcomes. Each operation's redacted Elo request payload is included only when setRequestPayloadCaptureEnabled has been turned on (off by default).
On-device inspection only — not a stable analytics pipeline; do not serialize its contents off the device. Mirrors iOS
Elo.Debug.snapshot().
-
shutdown
final static Unit shutdown()
Tear down the SDK. Cancels any in-flight
loadAdand clears state.
-
getSdkVersion
final static String getSdkVersion()
-
getIsDisabled
final static Boolean getIsDisabled()
-
-
-
-