> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adrop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference

> Detailed reference for all classes, interfaces, and enums in the Adrop Android SDK.

## Adrop

The main class of the Adrop SDK. Handles SDK initialization and global settings.

### Static Methods

| Method                                                                                                     | Description                                                                                                  |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `initialize(context: Application, production: Boolean)`                                                    | Initializes the SDK.                                                                                         |
| `initialize(context: Application, production: Boolean, targetCountries: Array<String>)`                    | Initializes the SDK with target countries.                                                                   |
| `initialize(context: Application, production: Boolean, targetCountries: Array<String>, tokenKey: String?)` | Initializes the SDK with target countries and token key.                                                     |
| `setUID(uid: String)`                                                                                      | Sets the user identifier. (Hashed with SHA-256)                                                              |
| `setTheme(theme: AdropTheme)`                                                                              | Sets the ad theme.                                                                                           |
| `setTokenKey(tokenKey: String)`                                                                            | Sets the app token key.                                                                                      |
| `handleDeepLink(intent: Intent): Boolean`                                                                  | Handles Adrop deep links.                                                                                    |
| `openQuest(context: Context, channel: String, path: String?)`                                              | Opens the Adrop Quest page.                                                                                  |
| `registerWebView(webView: WebView)`                                                                        | Registers a WebView for backfill ads support. Requires `adrop-ads-backfill` module. Call on the main thread. |

### Static Properties

| Property         | Type                   | Description                                                                       |
| ---------------- | ---------------------- | --------------------------------------------------------------------------------- |
| `isProduction`   | `Boolean`              | Whether in production mode                                                        |
| `sdkVersion`     | `String`               | SDK version                                                                       |
| `consentManager` | `AdropConsentManager?` | Consent manager instance (auto-configured when `adrop-ads-backfill` is installed) |

### Usage Example

```kotlin theme={null}
// Initialization
Adrop.initialize(application, production = true)

// Set user ID
Adrop.setUID("user123")

// Set theme
Adrop.setTheme(AdropTheme.DARK)

// Handle deep link
override fun onNewIntent(intent: Intent?) {
    super.onNewIntent(intent)
    intent?.let { Adrop.handleDeepLink(it) }
}
```

***

## AdropTheme

Enum for setting dark mode for ads.

### Values

| Value   | Description                                    |
| ------- | ---------------------------------------------- |
| `LIGHT` | Light mode                                     |
| `DARK`  | Dark mode                                      |
| `AUTO`  | Follow system settings automatically (default) |

### Usage Example

```kotlin theme={null}
Adrop.setTheme(AdropTheme.DARK)
```

***

## AdropErrorCode

Error codes that may occur when loading and displaying ads.

### Values

| Error Code                                | Description                  |
| ----------------------------------------- | ---------------------------- |
| `ERROR_CODE_NETWORK`                      | Network error                |
| `ERROR_CODE_INTERNAL`                     | Internal error               |
| `ERROR_CODE_INITIALIZE`                   | SDK initialization error     |
| `ERROR_CODE_INVALID_UNIT`                 | Invalid ad unit ID           |
| `ERROR_CODE_NOT_TARGET_COUNTRY`           | Not in target country        |
| `ERROR_CODE_AD_INACTIVE`                  | Inactive ad                  |
| `ERROR_CODE_AD_NO_FILL`                   | No ad available to display   |
| `ERROR_CODE_AD_BACKFILL_NO_FILL`          | No backfill ad available     |
| `ERROR_CODE_AD_LOAD_DUPLICATED`           | Duplicate ad load request    |
| `ERROR_CODE_AD_LOADING`                   | Ad is loading                |
| `ERROR_CODE_AD_EMPTY`                     | Ad is empty                  |
| `ERROR_CODE_AD_SHOWN`                     | Ad has already been shown    |
| `ERROR_CODE_AD_HIDE_FOR_TODAY`            | "Don't show today" is set    |
| `ERROR_CODE_ACCOUNT_USAGE_LIMIT_EXCEEDED` | Account usage limit exceeded |
| `ERROR_CODE_LANDSCAPE_UNSUPPORTED`        | Landscape mode not supported |

***

## AdropAdChoicesPosition

Enum for setting the AdChoices badge position on backfill native ads.

### Values

| Value          | Description                |
| -------------- | -------------------------- |
| `TOP_LEFT`     | Top-left corner            |
| `TOP_RIGHT`    | Top-right corner (default) |
| `BOTTOM_LEFT`  | Bottom-left corner         |
| `BOTTOM_RIGHT` | Bottom-right corner        |

### Usage Example

```kotlin theme={null}
val nativeAd = AdropNativeAd(this, "YOUR_UNIT_ID")
nativeAd.preferredAdChoicesPosition = AdropAdChoicesPosition.BOTTOM_RIGHT
nativeAd.load()
```

***

## AdropBanner

View class for displaying banner ads.

### Constructor

```kotlin theme={null}
// Use in XML
AdropBanner(context: Context, attrs: AttributeSet?)

// Use in code
AdropBanner(context: Context, unitId: String, contextId: String? = null)
```

### Properties

| Property                | Type                   | Description                                           |
| ----------------------- | ---------------------- | ----------------------------------------------------- |
| `listener`              | `AdropBannerListener?` | Banner event listener                                 |
| `shouldAdjustHtmlStyle` | `Boolean`              | Whether to auto-adjust HTML style (default: false)    |
| `useCustomClick`        | `Boolean`              | Whether to use custom click handling (default: false) |
| `adSize`                | `CreativeSize?`        | Banner size for backfill ads (dp)                     |
| `contextId`             | `String`               | Context ID                                            |
| `creativeId`            | `String`               | Creative ID                                           |
| `txId`                  | `String`               | Transaction ID                                        |
| `campaignId`            | `String`               | Campaign ID                                           |
| `destinationURL`        | `String`               | Destination URL                                       |
| `creativeSize`          | `CreativeSize`         | Creative size                                         |
| `isBackfilled`          | `Boolean`              | Whether it's a backfill ad                            |
| `browserTarget`         | `Int`                  | Browser target for opening destination URL            |

### Methods

| Method                      | Description          |
| --------------------------- | -------------------- |
| `setUnitId(unitId: String)` | Set ad unit ID       |
| `getUnitId(): String`       | Get ad unit ID       |
| `load()`                    | Load ad              |
| `open(url: String?)`        | Open ad landing page |
| `destroy()`                 | Destroy banner ad    |

### Companion Methods

| Method                                         | Description                                                                                  |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `loads(context, unitId, contextId?, listener)` | Batch load up to 5 banner ads — see [Batch Loading](/sdk/android/banner#batch-loading-loads) |

### Usage Example

```kotlin theme={null}
val banner = AdropBanner(this, "YOUR_UNIT_ID")
banner.listener = object : AdropBannerListener {
    override fun onAdReceived(banner: AdropBanner) {
        // Ad received successfully
    }

    override fun onAdFailedToReceive(banner: AdropBanner, errorCode: AdropErrorCode) {
        // Failed to receive ad
    }

    override fun onAdClicked(banner: AdropBanner) {
        // Ad clicked
    }
}

// Load ad
banner.load()
```

***

## AdropBannerListener

Interface for handling banner ad events.

### Methods

| Method                                                                | Description                                                             |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `onAdReceived(banner: AdropBanner)`                                   | Ad received successfully                                                |
| `onAdClicked(banner: AdropBanner)`                                    | Ad clicked                                                              |
| `onAdImpression(banner: AdropBanner)`                                 | Ad impression (optional implementation)                                 |
| `onAdFailedToReceive(banner: AdropBanner, errorCode: AdropErrorCode)` | Failed to receive ad                                                    |
| `onAdVideoStart(banner: AdropBanner)`                                 | Video playback started (optional implementation)                        |
| `onAdVideoEnd(banner: AdropBanner)`                                   | Video playback ended (optional implementation)                          |
| `onAdsReceived(banners: List<AdropBanner>)`                           | Batch ads received from `AdropBanner.loads()` (optional implementation) |
| `onAdsFailedToReceive(errorCode: AdropErrorCode)`                     | Batch load failed from `AdropBanner.loads()` (optional implementation)  |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropNativeAd

Class for displaying native ads.

### Constructor

```kotlin theme={null}
AdropNativeAd(context: Context, unitId: String, contextId: String? = null)
```

### Properties

| Property                     | Type                     | Description                                                             |
| ---------------------------- | ------------------------ | ----------------------------------------------------------------------- |
| `unitId`                     | `String`                 | Ad unit ID                                                              |
| `contextId`                  | `String?`                | Context ID                                                              |
| `listener`                   | `AdropNativeAdListener?` | Native ad event listener                                                |
| `useCustomClick`             | `Boolean`                | Whether to use custom click handling                                    |
| `preferredAdChoicesPosition` | `AdropAdChoicesPosition` | AdChoices badge position for backfill native ads (default: `TOP_RIGHT`) |
| `context`                    | `Context`                | Context                                                                 |
| `isLoaded`                   | `Boolean`                | Whether ad loading is complete                                          |
| `isDestroyed`                | `Boolean`                | Whether ad is destroyed                                                 |
| `creativeId`                 | `String`                 | Creative ID                                                             |
| `txId`                       | `String`                 | Transaction ID                                                          |
| `campaignId`                 | `String`                 | Campaign ID                                                             |
| `creativeSize`               | `CreativeSize`           | Creative size                                                           |
| `icon`                       | `String`                 | Icon image URL                                                          |
| `cover`                      | `String`                 | Cover image URL                                                         |
| `headline`                   | `String`                 | Headline                                                                |
| `body`                       | `String`                 | Body text                                                               |
| `creative`                   | `String`                 | Creative URL                                                            |
| `asset`                      | `String`                 | Asset URL                                                               |
| `destinationURL`             | `String`                 | Destination URL                                                         |
| `advertiser`                 | `String`                 | **Deprecated.** Use `profile.displayName` instead.                      |
| `advertiserURL`              | `String`                 | **Deprecated.** Use `profile.link` instead.                             |
| `accountTag`                 | `JSONObject`             | **Deprecated.** No longer supported.                                    |
| `creativeTag`                | `JSONObject`             | **Deprecated.** No longer supported.                                    |
| `callToAction`               | `String`                 | Call to action text                                                     |
| `extra`                      | `JSONObject`             | Extra data                                                              |
| `profile`                    | `AdropNativeAdProfile`   | Profile information                                                     |
| `isBackfilled`               | `Boolean`                | Whether it's a backfill ad                                              |
| `browserTarget`              | `Int`                    | Browser target for opening destination URL                              |

### Methods

| Method      | Description |
| ----------- | ----------- |
| `load()`    | Load ad     |
| `destroy()` | Destroy ad  |

### Companion Methods

| Method                                         | Description                                                                                  |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `loads(context, unitId, contextId?, listener)` | Batch load up to 5 native ads — see [Batch Loading](/sdk/android/native#batch-loading-loads) |

### Usage Example

```kotlin theme={null}
val nativeAd = AdropNativeAd(this, "YOUR_UNIT_ID")
nativeAd.listener = object : AdropNativeAdListener {
    override fun onAdReceived(ad: AdropNativeAd) {
        // Bind ad data
        headlineTextView.text = ad.headline
        bodyTextView.text = ad.body
        advertiserTextView.text = ad.advertiser
        ctaButton.text = ad.callToAction

        // Set ad to view
        nativeAdView.setNativeAd(ad)
    }

    override fun onAdFailedToReceive(ad: AdropNativeAd, errorCode: AdropErrorCode) {
        // Failed to receive ad
    }

    override fun onAdClicked(ad: AdropNativeAd) {
        // Ad clicked
    }
}

nativeAd.load()
```

***

## AdropNativeAdView

Container view for rendering native ads.

### Constructor

```kotlin theme={null}
AdropNativeAdView(context: Context, attrs: AttributeSet?)
```

### Properties

| Property        | Type      | Description                      |
| --------------- | --------- | -------------------------------- |
| `isEntireClick` | `Boolean` | Whether entire area is clickable |

### Methods

| Method                                                       | Description                            |
| ------------------------------------------------------------ | -------------------------------------- |
| `setIconView(view: View, listener: OnClickListener?)`        | Set icon view (ImageView only)         |
| `setHeadLineView(view: View, listener: OnClickListener?)`    | Set headline view (TextView only)      |
| `setBodyView(view: View)`                                    | Set body view (TextView only)          |
| `setMediaView(view: AdropMediaView)`                         | Set media view                         |
| `setAdvertiserView(view: View, listener: OnClickListener?)`  | Set advertiser view (TextView only)    |
| `setCallToActionView(view: View)`                            | Set call to action button view         |
| `setProfileNameView(view: View, listener: OnClickListener?)` | Set profile name view                  |
| `setProfileLogoView(view: View, listener: OnClickListener?)` | Set profile logo view (ImageView only) |
| `setNativeAd(ad: AdropNativeAd)`                             | Set native ad                          |
| `destroy()`                                                  | Destroy view                           |

### Usage Example

```kotlin theme={null}
// Reference views from layout
val nativeAdView = findViewById<AdropNativeAdView>(R.id.native_ad_view)
val iconView = findViewById<ImageView>(R.id.ad_icon)
val headlineView = findViewById<TextView>(R.id.ad_headline)
val bodyView = findViewById<TextView>(R.id.ad_body)
val mediaView = findViewById<AdropMediaView>(R.id.ad_media)
val advertiserView = findViewById<TextView>(R.id.ad_advertiser)
val ctaView = findViewById<Button>(R.id.ad_cta)

// Set views
nativeAdView.setIconView(iconView)
nativeAdView.setHeadLineView(headlineView)
nativeAdView.setBodyView(bodyView)
nativeAdView.setMediaView(mediaView)
nativeAdView.setAdvertiserView(advertiserView)
nativeAdView.setCallToActionView(ctaView)

// Set after ad loads
nativeAd.listener = object : AdropNativeAdListener {
    override fun onAdReceived(ad: AdropNativeAd) {
        nativeAdView.setNativeAd(ad)
    }
}
```

***

## AdropNativeAdListener

Interface for handling native ad events.

### Methods

| Method                                                              | Description                                                               |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `onAdReceived(ad: AdropNativeAd)`                                   | Ad received successfully                                                  |
| `onAdClicked(ad: AdropNativeAd)`                                    | Ad clicked                                                                |
| `onAdImpression(ad: AdropNativeAd)`                                 | Ad impression (optional implementation)                                   |
| `onAdFailedToReceive(ad: AdropNativeAd, errorCode: AdropErrorCode)` | Failed to receive ad                                                      |
| `onAdVideoStart(ad: AdropNativeAd)`                                 | Video playback started (optional implementation)                          |
| `onAdVideoEnd(ad: AdropNativeAd)`                                   | Video playback ended (optional implementation)                            |
| `onAdsReceived(ads: List<AdropNativeAd>)`                           | Batch ads received from `AdropNativeAd.loads()` (optional implementation) |
| `onAdsFailedToReceive(errorCode: AdropErrorCode)`                   | Batch load failed from `AdropNativeAd.loads()` (optional implementation)  |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropNativeAdProfile

Data class containing profile information for native ads.

### Properties

| Property      | Type     | Description            |
| ------------- | -------- | ---------------------- |
| `displayLogo` | `String` | Profile logo image URL |
| `displayName` | `String` | Profile name           |
| `link`        | `String` | Profile link URL       |

### Usage Example

```kotlin theme={null}
val profile = nativeAd.profile
profileNameTextView.text = profile.displayName
// Load profile logo into ImageView
```

***

## AdropMediaView

View for displaying native ad media content.

### Constructor

```kotlin theme={null}
AdropMediaView(context: Context, attrs: AttributeSet?)
```

### Description

The media view displays image or video content for native ads. It should be set through the `setMediaView()` method of `AdropNativeAdView`.

***

## AdropInterstitialAd

Class for displaying interstitial ads.

### Constructor

```kotlin theme={null}
AdropInterstitialAd(context: Context, unitId: String)
```

### Properties

| Property                 | Type                                | Description                                |
| ------------------------ | ----------------------------------- | ------------------------------------------ |
| `interstitialAdListener` | `AdropInterstitialAdListener?`      | Interstitial ad event listener             |
| `closeListener`          | `AdropInterstitialAdCloseListener?` | Interstitial ad close event listener       |
| `context`                | `Context?`                          | Context                                    |
| `unitId`                 | `String`                            | Ad unit ID                                 |
| `isLoaded`               | `Boolean`                           | Whether ad loading is complete             |
| `creativeId`             | `String`                            | Creative ID                                |
| `txId`                   | `String`                            | Transaction ID                             |
| `campaignId`             | `String`                            | Campaign ID                                |
| `isBackfilled`           | `Boolean`                           | Whether it's a backfill ad                 |
| `browserTarget`          | `Int`                               | Browser target for opening destination URL |

### Methods

| Method                         | Description                                |
| ------------------------------ | ------------------------------------------ |
| `load()`                       | Load ad                                    |
| `show(fromActivity: Activity)` | Show ad                                    |
| `close()`                      | Programmatically close the interstitial ad |
| `destroy()`                    | Destroy ad                                 |

### Usage Example

```kotlin theme={null}
val interstitialAd = AdropInterstitialAd(this, "YOUR_UNIT_ID")

interstitialAd.interstitialAdListener = object : AdropInterstitialAdListener {
    override fun onAdReceived(ad: AdropInterstitialAd) {
        // Ad loaded, ready to show
        ad.show(this@MainActivity)
    }

    override fun onAdFailedToReceive(ad: AdropInterstitialAd, errorCode: AdropErrorCode) {
        // Failed to receive ad
    }

    override fun onAdDidDismissFullScreen(ad: AdropInterstitialAd) {
        // Ad closed
    }
}

// Load ad
interstitialAd.load()
```

***

## AdropInterstitialAdListener

Interface for handling interstitial ad events.

### Methods

| Method                                                                           | Description                                           |
| -------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `onAdReceived(ad: AdropInterstitialAd)`                                          | Ad received successfully                              |
| `onAdFailedToReceive(ad: AdropInterstitialAd, errorCode: AdropErrorCode)`        | Failed to receive ad                                  |
| `onAdImpression(ad: AdropInterstitialAd)`                                        | Ad impression (optional implementation)               |
| `onAdClicked(ad: AdropInterstitialAd)`                                           | Ad clicked (optional implementation)                  |
| `onAdWillPresentFullScreen(ad: AdropInterstitialAd)`                             | Full screen ad will present (optional implementation) |
| `onAdDidPresentFullScreen(ad: AdropInterstitialAd)`                              | Full screen ad did present (optional implementation)  |
| `onAdWillDismissFullScreen(ad: AdropInterstitialAd)`                             | Full screen ad will dismiss (optional implementation) |
| `onAdDidDismissFullScreen(ad: AdropInterstitialAd)`                              | Full screen ad did dismiss (optional implementation)  |
| `onAdFailedToShowFullScreen(ad: AdropInterstitialAd, errorCode: AdropErrorCode)` | Failed to show ad (optional implementation)           |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropInterstitialAdCloseListener

Interface for handling interstitial ad close events.

### Methods

| Method                                   | Description                                                                                             |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `onBackPressed(ad: AdropInterstitialAd)` | Called when the back button is pressed while the interstitial ad is displayed (optional implementation) |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropRewardedAd

Class for displaying rewarded ads.

### Constructor

```kotlin theme={null}
AdropRewardedAd(context: Context, unitId: String)
```

### Properties

| Property                        | Type                             | Description                                           |
| ------------------------------- | -------------------------------- | ----------------------------------------------------- |
| `rewardedAdListener`            | `AdropRewardedAdListener?`       | Rewarded ad event listener                            |
| `context`                       | `Context?`                       | Context                                               |
| `unitId`                        | `String`                         | Ad unit ID                                            |
| `isLoaded`                      | `Boolean`                        | Whether ad loading is complete                        |
| `creativeId`                    | `String`                         | Creative ID                                           |
| `txId`                          | `String`                         | Transaction ID                                        |
| `campaignId`                    | `String`                         | Campaign ID                                           |
| `isBackfilled`                  | `Boolean`                        | Whether it's a backfill ad                            |
| `serverSideVerificationOptions` | `ServerSideVerificationOptions?` | Server-side verification options (userId, customData) |
| `browserTarget`                 | `Int`                            | Browser target for opening destination URL            |

### Methods

| Method                                                                                  | Description                 |
| --------------------------------------------------------------------------------------- | --------------------------- |
| `load()`                                                                                | Load ad                     |
| `show(fromActivity: Activity, userDidEarnRewardHandler: AdropUserDidEarnRewardHandler)` | Show ad with reward handler |
| `destroy()`                                                                             | Destroy ad                  |

### Usage Example

```kotlin theme={null}
val rewardedAd = AdropRewardedAd(this, "YOUR_UNIT_ID")

rewardedAd.rewardedAdListener = object : AdropRewardedAdListener {
    override fun onAdReceived(ad: AdropRewardedAd) {
        // Ad loaded
        ad.show(this@MainActivity) { type, amount ->
            // Grant reward
            Log.d("Reward", "Type: $type, Amount: $amount")
        }
    }

    override fun onAdFailedToReceive(ad: AdropRewardedAd, errorCode: AdropErrorCode) {
        // Failed to receive ad
    }
}

rewardedAd.load()
```

***

## AdropRewardedAdListener

Interface for handling rewarded ad events.

### Methods

| Method                                                                       | Description                                           |
| ---------------------------------------------------------------------------- | ----------------------------------------------------- |
| `onAdReceived(ad: AdropRewardedAd)`                                          | Ad received successfully                              |
| `onAdFailedToReceive(ad: AdropRewardedAd, errorCode: AdropErrorCode)`        | Failed to receive ad                                  |
| `onAdImpression(ad: AdropRewardedAd)`                                        | Ad impression (optional implementation)               |
| `onAdClicked(ad: AdropRewardedAd)`                                           | Ad clicked (optional implementation)                  |
| `onAdWillPresentFullScreen(ad: AdropRewardedAd)`                             | Full screen ad will present (optional implementation) |
| `onAdDidPresentFullScreen(ad: AdropRewardedAd)`                              | Full screen ad did present (optional implementation)  |
| `onAdWillDismissFullScreen(ad: AdropRewardedAd)`                             | Full screen ad will dismiss (optional implementation) |
| `onAdDidDismissFullScreen(ad: AdropRewardedAd)`                              | Full screen ad did dismiss (optional implementation)  |
| `onAdFailedToShowFullScreen(ad: AdropRewardedAd, errorCode: AdropErrorCode)` | Failed to show ad (optional implementation)           |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropUserDidEarnRewardHandler

Type alias called when a reward is granted.

### Definition

```kotlin theme={null}
typealias AdropUserDidEarnRewardHandler = (type: Int, amount: Int) -> Unit
```

### Parameters

| Parameter | Type  | Description   |
| --------- | ----- | ------------- |
| `type`    | `Int` | Reward type   |
| `amount`  | `Int` | Reward amount |

### Usage Example

```kotlin theme={null}
rewardedAd.show(this) { type, amount ->
    // Grant reward to user
    when (type) {
        0 -> grantCoins(amount)
        1 -> grantLives(amount)
    }
}
```

***

## AdropPopupAd

Class for displaying popup ads.

### Constructor

```kotlin theme={null}
AdropPopupAd(context: Context, unitId: String)
```

### Properties

| Property                | Type                         | Description                                |
| ----------------------- | ---------------------------- | ------------------------------------------ |
| `popupAdListener`       | `AdropPopupAdListener?`      | Popup ad event listener                    |
| `closeListener`         | `AdropPopupAdCloseListener?` | Popup close event listener                 |
| `useCustomClick`        | `Boolean`                    | Whether to use custom click handling       |
| `closeTextColor`        | `Int?`                       | Close button text color                    |
| `hideForTodayTextColor` | `Int?`                       | "Don't show today" text color              |
| `ctaTextColor`          | `Int?`                       | CTA button text color                      |
| `backgroundColor`       | `Int?`                       | Background color                           |
| `unitId`                | `String`                     | Ad unit ID                                 |
| `creativeIds`           | `List<String>`               | Creative ID list                           |
| `creativeId`            | `String`                     | Current creative ID                        |
| `destinationURL`        | `String`                     | Destination URL                            |
| `isLoaded`              | `Boolean`                    | Whether ad loading is complete             |
| `txId`                  | `String`                     | Transaction ID                             |
| `campaignId`            | `String`                     | Campaign ID                                |
| `browserTarget`         | `Int`                        | Browser target for opening destination URL |

### Methods

| Method                     | Description          |
| -------------------------- | -------------------- |
| `load()`                   | Load ad              |
| `show(activity: Activity)` | Show ad              |
| `open(url: String?)`       | Open ad landing page |
| `close()`                  | Close ad             |
| `destroy()`                | Destroy ad           |

### Usage Example

```kotlin theme={null}
val popupAd = AdropPopupAd(this, "YOUR_UNIT_ID")

// Customize style
popupAd.closeTextColor = Color.WHITE
popupAd.backgroundColor = Color.parseColor("#80000000")

popupAd.popupAdListener = object : AdropPopupAdListener {
    override fun onAdReceived(ad: AdropPopupAd) {
        // Ad loaded
        ad.show(this@MainActivity)
    }

    override fun onAdFailedToReceive(ad: AdropPopupAd, errorCode: AdropErrorCode) {
        // Failed to receive ad
    }
}

popupAd.closeListener = object : AdropPopupAdCloseListener {
    override fun onTodayOffClicked(ad: AdropPopupAd) {
        // "Don't show today" clicked
    }
}

popupAd.load()
```

***

## AdropPopupAdListener

Interface for handling popup ad events.

### Methods

| Method                                                                    | Description                                           |
| ------------------------------------------------------------------------- | ----------------------------------------------------- |
| `onAdReceived(ad: AdropPopupAd)`                                          | Ad received successfully                              |
| `onAdFailedToReceive(ad: AdropPopupAd, errorCode: AdropErrorCode)`        | Failed to receive ad                                  |
| `onAdImpression(ad: AdropPopupAd)`                                        | Ad impression (optional implementation)               |
| `onAdClicked(ad: AdropPopupAd)`                                           | Ad clicked (optional implementation)                  |
| `onAdWillPresentFullScreen(ad: AdropPopupAd)`                             | Full screen ad will present (optional implementation) |
| `onAdDidPresentFullScreen(ad: AdropPopupAd)`                              | Full screen ad did present (optional implementation)  |
| `onAdWillDismissFullScreen(ad: AdropPopupAd)`                             | Full screen ad will dismiss (optional implementation) |
| `onAdDidDismissFullScreen(ad: AdropPopupAd)`                              | Full screen ad did dismiss (optional implementation)  |
| `onAdFailedToShowFullScreen(ad: AdropPopupAd, errorCode: AdropErrorCode)` | Failed to show ad (optional implementation)           |
| `onAdVideoStart(ad: AdropPopupAd)`                                        | Video playback started (optional implementation)      |
| `onAdVideoEnd(ad: AdropPopupAd)`                                          | Video playback ended (optional implementation)        |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropPopupAdCloseListener

Interface for handling popup ad close events.

### Methods

| Method                                | Description                                          |
| ------------------------------------- | ---------------------------------------------------- |
| `onClosed(ad: AdropPopupAd)`          | Popup closed (optional implementation)               |
| `onDimClicked(ad: AdropPopupAd)`      | Dim area clicked (optional implementation)           |
| `onTodayOffClicked(ad: AdropPopupAd)` | "Don't show today" clicked (optional implementation) |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropSplashAd

Class for displaying splash ads.

### Constructor

```kotlin theme={null}
AdropSplashAd(application: Application, shouldSkip: ((splashAd: AdropSplashAd) -> Boolean)? = null)
```

### Parameters

| Parameter     | Type                            | Description                                                |
| ------------- | ------------------------------- | ---------------------------------------------------------- |
| `application` | `Application`                   | Application instance                                       |
| `shouldSkip`  | `((AdropSplashAd) -> Boolean)?` | Function to determine whether to skip splash ad (optional) |

### Properties

| Property           | Type                     | Description              |
| ------------------ | ------------------------ | ------------------------ |
| `splashAdListener` | `AdropSplashAdListener?` | Splash ad event listener |
| `creativeId`       | `String`                 | Creative ID              |
| `isClosed`         | `Boolean`                | Whether ad is closed     |
| `isDestroyed`      | `Boolean`                | Whether ad is destroyed  |
| `unitId`           | `String`                 | Ad unit ID               |

### Methods

| Method      | Description                                          |
| ----------- | ---------------------------------------------------- |
| `close()`   | Close ad                                             |
| `destroy()` | Release resources and unregister lifecycle callbacks |

### Usage Example

```kotlin theme={null}
// Need to add AdropSplashAdActivity to AndroidManifest.xml
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        val splashAd = AdropSplashAd(this) { ad ->
            // Skip under certain conditions
            false
        }

        splashAd.splashAdListener = object : AdropSplashAdListener {
            override fun onAdReceived(ad: AdropSplashAd) {
                // Ad received
            }

            override fun onAdClose(ad: AdropSplashAd, impressed: Boolean) {
                // Ad closed
            }
        }
    }
}
```

***

## AdropSplashAdListener

Interface for handling splash ad events.

### Methods

| Method                                                              | Description                                        |
| ------------------------------------------------------------------- | -------------------------------------------------- |
| `onAdReceived(ad: AdropSplashAd)`                                   | Ad received successfully (optional implementation) |
| `onAdFailedToReceive(ad: AdropSplashAd, errorCode: AdropErrorCode)` | Failed to receive ad (optional implementation)     |
| `onAdImpression(ad: AdropSplashAd)`                                 | Ad impression (optional implementation)            |
| `onAdClose(ad: AdropSplashAd, impressed: Boolean)`                  | Ad closed (required implementation)                |

### Parameters

| Parameter   | Type      | Description                           |
| ----------- | --------- | ------------------------------------- |
| `impressed` | `Boolean` | Whether the ad was actually impressed |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropSplashAdView

Class for displaying splash ads as a view.

### Constructor

```kotlin theme={null}
AdropSplashAdView(context: Context, unitId: String, adRequestTimeout: Long = 1000L)
AdropSplashAdView(context: Context, attrs: AttributeSet?)
```

### Properties

| Property          | Type                         | Description                                   |
| ----------------- | ---------------------------- | --------------------------------------------- |
| `listener`        | `AdropSplashAdViewListener?` | Splash ad view event listener                 |
| `displayDuration` | `Long`                       | Display duration (Deprecated: Set in console) |
| `creativeId`      | `String`                     | Creative ID                                   |
| `isClosed`        | `Boolean`                    | Whether ad is closed                          |
| `unitId`          | `String`                     | Ad unit ID                                    |
| `txId`            | `String`                     | Transaction ID                                |
| `campaignId`      | `String`                     | Campaign ID                                   |

### Methods

| Method      | Description                                              |
| ----------- | -------------------------------------------------------- |
| `load()`    | Load ad                                                  |
| `destroy()` | Release resources (timers, visibility tracker, listener) |

### Usage Example

```kotlin theme={null}
val splashAdView = AdropSplashAdView(this, "YOUR_UNIT_ID", adRequestTimeout = 2000L)

splashAdView.listener = object : AdropSplashAdViewListener {
    override fun onAdReceived(ad: AdropSplashAdView) {
        // Ad received
    }

    override fun onAdClose(ad: AdropSplashAdView, impressed: Boolean) {
        // Ad closed - navigate to main screen
        if (impressed) {
            // Ad was impressed
        }
        startMainActivity()
    }
}

// Add to layout
container.addView(splashAdView)
splashAdView.load()
```

***

## AdropSplashAdViewListener

Interface for handling splash ad view events.

### Methods

| Method                                                                  | Description                                        |
| ----------------------------------------------------------------------- | -------------------------------------------------- |
| `onAdReceived(ad: AdropSplashAdView)`                                   | Ad received successfully (optional implementation) |
| `onAdFailedToReceive(ad: AdropSplashAdView, errorCode: AdropErrorCode)` | Failed to receive ad (optional implementation)     |
| `onAdImpression(ad: AdropSplashAdView)`                                 | Ad impression (optional implementation)            |
| `onAdClose(ad: AdropSplashAdView, impressed: Boolean)`                  | Ad closed (required implementation)                |

<Note>
  All callbacks are called on the main thread (`@UiThread`).
</Note>

***

## AdropKey

Class that defines user property keys.

### Constants

| Constant | Value     | Description   |
| -------- | --------- | ------------- |
| `AGE`    | `"AGE"`   | Age           |
| `BIRTH`  | `"BIRTH"` | Date of birth |
| `GENDER` | `"GDR"`   | Gender        |

### Usage Example

```kotlin theme={null}
val params = AdropEventParam.Builder()
    .putInt(AdropKey.AGE, 25)
    .putString(AdropKey.GENDER, AdropValue.AdropGender.MALE)
    .putString(AdropKey.BIRTH, "19990101")
    .build()
```

***

## AdropValue

Class that defines user property values.

### Common Constants

| Constant  | Value | Description |
| --------- | ----- | ----------- |
| `UNKNOWN` | `"U"` | Unknown     |

### AdropBirth

Defines date of birth formats.

| Constant             | Value        | Description                           |
| -------------------- | ------------ | ------------------------------------- |
| `formatYear`         | `"yyyy"`     | Year only (e.g., 1999)                |
| `formatYearMonth`    | `"yyyyMM"`   | Year and month (e.g., 199901)         |
| `formatYearMonthDay` | `"yyyyMMdd"` | Year, month, and day (e.g., 19990101) |

### AdropGender

Defines gender values.

| Constant | Value | Description |
| -------- | ----- | ----------- |
| `MALE`   | `"M"` | Male        |
| `FEMALE` | `"F"` | Female      |
| `OTHER`  | `"O"` | Other       |

### Usage Example

```kotlin theme={null}
val params = AdropEventParam.Builder()
    .putString(AdropKey.GENDER, AdropValue.AdropGender.MALE)
    .putString(AdropKey.BIRTH, "19990101") // Using formatYearMonthDay
    .build()
```

***

## CreativeSize

Data class representing the size of a creative.

### Properties

| Property | Type     | Description |
| -------- | -------- | ----------- |
| `width`  | `Double` | Width (dp)  |
| `height` | `Double` | Height (dp) |

### Usage Example

```kotlin theme={null}
val banner = AdropBanner(this, "YOUR_UNIT_ID")
banner.adSize = CreativeSize(320.0, 50.0)
```

***

## AdropEventParam

Class for creating custom event parameters.

### Builder Methods

| Method                                    | Description                            |
| ----------------------------------------- | -------------------------------------- |
| `putBoolean(key: String, value: Boolean)` | Add Boolean value                      |
| `putInt(key: String, value: Int)`         | Add Int value                          |
| `putFloat(key: String, value: Float)`     | Add Float value                        |
| `putString(key: String, value: String)`   | Add String value (max 1024 characters) |
| `putLong(key: String, value: Long)`       | Add Long value (max: 9007199254740991) |
| `putItems(items: List<AdropEventParam>)`  | Add item list for multi-item events    |
| `build()`                                 | Create AdropEventParam instance        |

### Usage Example

```kotlin theme={null}
val params = AdropEventParam.Builder()
    .putString(AdropKey.GENDER, AdropValue.AdropGender.MALE)
    .putInt(AdropKey.AGE, 25)
    .putString(AdropKey.BIRTH, "19990101")
    .build()
```

<Note>
  * Parameter key must be 1–64 characters.
  * String values are limited to 1024 characters maximum.
  * The value passed to `putLong()` cannot exceed JavaScript's MAX\_SAFE\_INTEGER (9007199254740991).
</Note>

***

## AdropMetrics

Singleton object for managing user events and properties.

### Static Properties

| Property          | Type         | Description                                        |
| ----------------- | ------------ | -------------------------------------------------- |
| `userDataConsent` | `Boolean`    | Current user data consent status (default: `true`) |
| `properties`      | `JSONObject` | Current custom user properties                     |

### Static Methods

| Method                                              | Description                                                                                                             |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `sendEvent(name: String, params: AdropEventParam?)` | Send a user event                                                                                                       |
| `logEvent(name: String, params: AdropEventParam?)`  | **Deprecated.** Use `sendEvent` instead.                                                                                |
| `setProperty(key: String, value: Any?)`             | Set a user property for targeting                                                                                       |
| `setUserDataConsent(consent: Boolean)`              | Set user data collection consent status. When `false`, server transmission is blocked (local storage is still allowed). |

<Warning>
  `logEvent()` is deprecated and will be removed in a future version. Use `sendEvent()` instead.
</Warning>

### sendEvent

Sends a user event with optional parameters.

```kotlin theme={null}
// Simple event (no parameters)
AdropMetrics.sendEvent("app_open")

// Event with parameters
val params = AdropEventParam.Builder()
    .putString("item_id", "SKU-123")
    .putString("item_name", "Widget")
    .putFloat("price", 29.99f)
    .build()
AdropMetrics.sendEvent("view_item", params)

// Multi-item event (e.g., purchase)
val item1 = AdropEventParam.Builder()
    .putString("item_id", "A")
    .putString("item_name", "Product A")
    .putInt("price", 100)
    .putInt("quantity", 1)
    .build()
val item2 = AdropEventParam.Builder()
    .putString("item_id", "B")
    .putString("item_name", "Product B")
    .putInt("price", 200)
    .putInt("quantity", 2)
    .build()
val purchaseParams = AdropEventParam.Builder()
    .putString("tx_id", "tx_123")
    .putString("currency", "KRW")
    .putItems(listOf(item1, item2))
    .build()
AdropMetrics.sendEvent("purchase", purchaseParams)
```

<Note>
  * Event name must be 1–64 characters.
  * Duplicate events with the same name and parameters are throttled (500ms window).
  * The SDK must be initialized before calling `sendEvent()`.
</Note>
