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.

      • setUserIdentifier

         final static Unit setUserIdentifier(String identifier)

        Identify the signed-in user with your own stable identifier.

        By default every ad request carries an anonymous, per-install visitor_id the SDK generates (anon_<UUID>). Setting an identifier replaces that value on all subsequent ad requests and tracking pings, so delivery, frequency capping, and reporting follow the account rather than the install.

        Elo.setUserIdentifier(account.id)  // sign-in
        Elo.setUserIdentifier(null)        // sign-out

        Notes:

        • Call it once the user is known, and pass null on sign-out. The order relative to configure does not matter. shutdown clears it; re-configuring does not, since a config refresh is not a sign-out.

        • The anonymous id is kept in storage untouched underneath, so clearing the identifier restores the sameanon_<UUID> the install had before.

        • It is held in memory only. Your app owns the value and re-sets it each launch, so a missed sign-out can't leave one user's identity on another's requests. Requests made before you set it use the anonymous id.

        • An ad keeps whichever identity it was requested under for its whole lifetime, so an impression firing after a sign-out is still reported against the request that fetched it.

        • Whitespace is trimmed; a blank string clears the identifier. Values longer than 256 characters (Unicode code points) are ignored with a warning.

        • Send an identifier your own systems use, not an email address or other directly identifying value — this id reaches Elo's ad server as the user's identity for targeting.

        Mirrors iOS Elo.setUserIdentifier.

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