Package 

Object Elo


  • 
    public class Elo
    
                        

    The 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.

    • 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 call configure(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 call configure(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 call configure(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 loadAd calls are unaffected. All options — including client-side mediation adapters — live on EloConfiguration; every field except EloConfiguration.elo has a sensible default.

      • disable

         final static Unit disable()

        Pause new ad requests without tearing down the SDK.

      • 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 = false for 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.

      • trackRender

         final static Unit trackRender(EloAd ad)

        Manual render-time hook for fully-custom views.

      • 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 loadAd and clears state.