> ## 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

> Complete API reference for the React Native SDK.

## Adrop

Class for initializing the Adrop SDK and managing global settings.

### initialize

```typescript theme={null}
static initialize(
  production: boolean,
  targetCountries?: string[],
  useInAppBrowser?: boolean
): void
```

Initializes the Adrop SDK.

**Parameters:**

* `production` (boolean): Production mode (true: production, false: development)
* `targetCountries` (string\[], optional): Target country code array (default: \[])
* `useInAppBrowser` (boolean, optional): Whether to use in-app browser (default: false)

**Example:**

```typescript theme={null}
import { Adrop } from 'adrop-ads-react-native'

Adrop.initialize(true, ['KR', 'US'], false)
```

### setUID

```typescript theme={null}
static setUID(uid: string): void
```

Sets the unique user identifier.

**Parameters:**

* `uid` (string): Unique user identifier

**Example:**

```typescript theme={null}
Adrop.setUID('user123')
```

### setTheme

```typescript theme={null}
static setTheme(theme: AdropTheme): void
```

Sets the app theme.

**Parameters:**

* `theme` (AdropTheme): Theme value ('light', 'dark', 'auto')

**Example:**

```typescript theme={null}
import { Adrop, AdropTheme } from 'adrop-ads-react-native'

Adrop.setTheme(AdropTheme.dark)
```

### registerWebView

```typescript theme={null}
static registerWebView(viewTag: number): Promise<void>
```

Registers a native WebView for backfill ad support. Call this after the WebView is mounted.

**Parameters:**

* `viewTag` (number): Native view tag obtained via `findNodeHandle()` from the `View` wrapping the WebView

**Example:**

```typescript theme={null}
import { useEffect, useRef } from 'react'
import { findNodeHandle, View } from 'react-native'
import { Adrop } from 'adrop-ads-react-native'

const containerRef = useRef<View>(null)

useEffect(() => {
  if (containerRef.current) {
    const tag = findNodeHandle(containerRef.current)
    if (tag != null) {
      Adrop.registerWebView(tag)
    }
  }
}, [])
```

<Warning>
  Requires `adrop-ads-backfill` module. If not installed, this call is silently ignored.
</Warning>

***

## AdropTheme

Constant object for specifying app theme.

```typescript theme={null}
const AdropTheme = {
  light: 'light',
  dark: 'dark',
  auto: 'auto',
} as const

type AdropTheme = (typeof AdropTheme)[keyof typeof AdropTheme]
```

**Values:**

* `light`: Light theme
* `dark`: Dark theme
* `auto`: Follow system setting

***

## BrowserTarget

Enum for specifying how ad destination URLs should be opened.

```typescript theme={null}
enum BrowserTarget {
  EXTERNAL = 0,
  INTERNAL = 1,
}
```

**Values:**

* `EXTERNAL`: Open URL in external browser (default)
* `INTERNAL`: Open URL in in-app browser

***

## AdropErrorCode

Error codes that may occur during ad loading and display.

```typescript theme={null}
enum AdropErrorCode {
  network = 'ERROR_CODE_NETWORK',
  internal = 'ERROR_CODE_INTERNAL',
  initialize = 'ERROR_CODE_INITIALIZE',
  invalidUnit = 'ERROR_CODE_INVALID_UNIT',
  notTargetCountry = 'ERROR_CODE_NOT_TARGET_COUNTRY',
  inactive = 'ERROR_CODE_AD_INACTIVE',
  adNoFill = 'ERROR_CODE_AD_NO_FILL',
  adDuplicated = 'ERROR_CODE_AD_LOAD_DUPLICATED',
  adLoading = 'ERROR_CODE_AD_LOADING',
  adEmpty = 'ERROR_CODE_AD_EMPTY',
  adShown = 'ERROR_CODE_AD_SHOWN',
  adHideForToday = 'ERROR_CODE_AD_HIDE_FOR_TODAY',
  adLandscapeUnsupported = 'ERROR_CODE_LANDSCAPE_UNSUPPORTED',
  backfillNoFill = 'ERROR_CODE_AD_BACKFILL_NO_FILL',
  undefined = 'UNDEFINED',
}
```

**Error Codes:**

* `network`: Network error
* `internal`: Internal error
* `initialize`: SDK initialization error
* `invalidUnit`: Invalid ad unit
* `notTargetCountry`: Not a target country
* `inactive`: Deactivated ad
* `adNoFill`: No ad available
* `adDuplicated`: Duplicate ad load request
* `adLoading`: Ad is loading
* `adEmpty`: Ad is empty
* `adShown`: Ad already shown
* `adHideForToday`: Ad hidden for today
* `adLandscapeUnsupported`: Landscape mode not supported
* `backfillNoFill`: Backfill ad not available
* `undefined`: Undefined error

***

## AdropAdChoicesPosition

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

### Definition

```typescript theme={null}
enum AdropAdChoicesPosition {
  topLeft = 0,
  topRight = 1,
  bottomLeft = 2,
  bottomRight = 3,
}
```

### Values

| Value         | Integer | Description                |
| ------------- | ------- | -------------------------- |
| `topLeft`     | 0       | Top-left corner            |
| `topRight`    | 1       | Top-right corner (default) |
| `bottomLeft`  | 2       | Bottom-left corner         |
| `bottomRight` | 3       | Bottom-right corner        |

### Usage Example

```typescript theme={null}
import { AdropNativeAd, AdropAdChoicesPosition } from 'adrop-ads-react-native'

const nativeAd = new AdropNativeAd(
  'YOUR_UNIT_ID',
  false,
  AdropAdChoicesPosition.bottomRight
)
```

***

## AdropBanner

React component for displaying banner ads.

### Props

```typescript theme={null}
type AdropBannerProp = {
  style: { height: number; width: number | string }
  unitId: string
  useCustomClick?: boolean
  adSize?: { width: number; height: number } | null
  autoLoad?: boolean
  onAdReceived?: (unitId: string, metadata?: AdropBannerMetadata) => void
  onAdImpression?: (unitId: string, metadata?: AdropBannerMetadata) => void
  onAdClicked?: (unitId: string, metadata?: AdropBannerMetadata) => void
  onAdFailedToReceive?: (unitId: string, errorCode?: any) => void
  onAdVideoStart?: (unitId: string) => void
  onAdVideoEnd?: (unitId: string) => void
}
```

**Props:**

* `style` (object, required): Banner style (including height and width)
* `unitId` (string, required): Ad unit ID
* `useCustomClick` (boolean, optional): Custom click handling (default: false)
* `adSize` (object, optional): Ad size setting
* `autoLoad` (boolean, optional): Auto load (default: true)
* `onAdReceived` (function, optional): Called on ad reception
* `onAdImpression` (function, optional): Called on ad impression
* `onAdClicked` (function, optional): Called on ad click
* `onAdFailedToReceive` (function, optional): Called on ad reception failure
* `onAdVideoStart` (function, optional): Called when a video ad starts playing
* `onAdVideoEnd` (function, optional): Called when a video ad finishes playing

### Methods

**load()**

```typescript theme={null}
load(): void
```

Loads the ad. (Called via ref)

### AdropBannerMetadata

```typescript theme={null}
type AdropBannerMetadata = {
  creativeId: string
  txId: string
  campaignId: string
  destinationURL: string
  browserTarget: BrowserTarget
}
```

**Example:**

```typescript theme={null}
import { AdropBanner } from 'adrop-ads-react-native'

<AdropBanner
  style={{ width: 320, height: 50 }}
  unitId="PUBLIC_TEST_UNIT_ID_320_50"
  onAdReceived={(unitId, metadata) => console.log('Ad received', metadata)}
  onAdFailedToReceive={(unitId, errorCode) => console.log('Ad failed', errorCode)}
/>
```

***

## AdropNativeAd

Class for managing native ads.

### Constructor

```typescript theme={null}
new AdropNativeAd(
  unitId: string,
  useCustomClick?: boolean,
  preferredAdChoicesPosition?: AdropAdChoicesPosition
)
```

**Parameters:**

| Parameter                    | Type                     | Description                                                                                   |
| ---------------------------- | ------------------------ | --------------------------------------------------------------------------------------------- |
| `unitId`                     | `string`                 | Ad unit ID                                                                                    |
| `useCustomClick`             | `boolean`                | Custom click handling (default: `false`)                                                      |
| `preferredAdChoicesPosition` | `AdropAdChoicesPosition` | AdChoices badge position for backfill native ads (default: `AdropAdChoicesPosition.topRight`) |

### Properties

**isLoaded** (readonly)

```typescript theme={null}
get isLoaded(): boolean
```

Returns whether the ad is loaded.

**unitId** (readonly)

```typescript theme={null}
get unitId(): string
```

Returns the ad unit ID.

**requestId** (readonly, deprecated)

```typescript theme={null}
get requestId(): string // deprecated - always returns ''
```

*Deprecated.* This property always returns an empty string and will be removed in future versions.

**creativeId** (readonly)

```typescript theme={null}
get creativeId(): string
```

Returns the creative ID.

**txId** (readonly)

```typescript theme={null}
get txId(): string
```

Returns the transaction ID.

**campaignId** (readonly)

```typescript theme={null}
get campaignId(): string
```

Returns the campaign ID.

**useCustomClick** (readonly)

```typescript theme={null}
get useCustomClick(): boolean
```

Returns whether custom click handling is enabled.

**isBackfilled** (readonly)

```typescript theme={null}
get isBackfilled(): boolean
```

Returns whether it's a backfill ad.

**isVideoAd** (readonly)

```typescript theme={null}
get isVideoAd(): boolean
```

Returns whether the ad is a video ad.

**browserTarget** (readonly)

```typescript theme={null}
get browserTarget(): BrowserTarget
```

Returns the browser target setting.

**properties** (readonly)

```typescript theme={null}
get properties(): AdropNativeProperties
```

Returns ad properties.

**listener**

```typescript theme={null}
listener?: AdropNativeAdListener
```

Sets the ad event listener.

### Methods

**load()**

```typescript theme={null}
load(): void
```

Loads the ad.

**destroy()**

```typescript theme={null}
destroy(): void
```

Releases the ad instance.

### AdropNativeProperties

```typescript theme={null}
type AdropNativeProperties = {
  icon?: string
  cover?: string
  headline?: string
  body?: string
  creative?: string
  asset?: string
  destinationURL?: string
  advertiserURL?: string
  accountTag?: string
  creativeTag?: string
  advertiser?: string
  callToAction?: string
  profile?: AdropNativeProfile
  extra?: Record<string, string>
  isBackfilled?: boolean
}
```

### AdropNativeProfile

```typescript theme={null}
type AdropNativeProfile = {
  displayName: string
  displayLogo: string
}
```

### AdropNativeAdListener

```typescript theme={null}
interface AdropNativeAdListener {
  onAdReceived?: (ad: AdropNativeAd) => void
  onAdClicked?: (ad: AdropNativeAd) => void
  onAdImpression?: (ad: AdropNativeAd) => void
  onAdFailedToReceive?: (ad: AdropNativeAd, errorCode?: any) => void
  onAdVideoStart?: (ad: AdropNativeAd) => void
  onAdVideoEnd?: (ad: AdropNativeAd) => void
}
```

***

## AdropNativeAdView

Container component for displaying native ads.

### Props

```typescript theme={null}
type Props = ViewProps & {
  nativeAd?: AdropNativeAd
}
```

**Props:**

* `nativeAd` (AdropNativeAd, optional): Native ad instance
* ...ViewProps: All React Native View props

**Example:**

```typescript theme={null}
import { AdropNativeAdView } from 'adrop-ads-react-native'

<AdropNativeAdView nativeAd={nativeAd}>
  {/* Native ad views */}
</AdropNativeAdView>
```

***

## Native Ad View Components

Components for displaying each element of a native ad. All components must be used inside `AdropNativeAdView`.

### AdropIconView

Displays the ad icon.

```typescript theme={null}
interface IconViewProps extends Omit<ImageProps, 'source'> {
  source?: ImageSourcePropType | undefined
}
```

**Example:**

```typescript theme={null}
import { AdropIconView } from 'adrop-ads-react-native'

<AdropIconView style={{ width: 50, height: 50 }} />
```

### AdropHeadLineView

Displays the ad headline.

```typescript theme={null}
const AdropHeadLineView: React.FC<TextProps>
```

**Example:**

```typescript theme={null}
import { AdropHeadLineView } from 'adrop-ads-react-native'

<AdropHeadLineView style={{ fontSize: 18, fontWeight: 'bold' }} />
```

### AdropBodyView

Displays the ad body text.

```typescript theme={null}
const AdropBodyView: React.FC<TextProps>
```

**Example:**

```typescript theme={null}
import { AdropBodyView } from 'adrop-ads-react-native'

<AdropBodyView style={{ fontSize: 14 }} />
```

### AdropMediaView

Displays the ad media (image/video).

```typescript theme={null}
const AdropMediaView: React.FC<ViewProps>
```

**Example:**

```typescript theme={null}
import { AdropMediaView } from 'adrop-ads-react-native'

<AdropMediaView style={{ width: '100%', height: 200 }} />
```

### AdropCallToActionView

Displays the ad CTA (Call To Action) button.

```typescript theme={null}
const AdropCallToActionView: React.FC<TextProps>
```

**Example:**

```typescript theme={null}
import { AdropCallToActionView } from 'adrop-ads-react-native'

<AdropCallToActionView
  style={{
    backgroundColor: '#007AFF',
    color: 'white',
    padding: 10
  }}
/>
```

### AdropAdvertiserView

Displays the advertiser information.

```typescript theme={null}
const AdropAdvertiserView: React.FC<TextProps>
```

**Example:**

```typescript theme={null}
import { AdropAdvertiserView } from 'adrop-ads-react-native'

<AdropAdvertiserView style={{ fontSize: 12, color: 'gray' }} />
```

### AdropProfileLogoView

Displays the profile logo.

```typescript theme={null}
interface IconViewProps extends Omit<ImageProps, 'source'> {
  source?: ImageSourcePropType | undefined
}
```

**Example:**

```typescript theme={null}
import { AdropProfileLogoView } from 'adrop-ads-react-native'

<AdropProfileLogoView style={{ width: 30, height: 30, borderRadius: 15 }} />
```

### AdropProfileNameView

Displays the profile name.

```typescript theme={null}
const AdropProfileNameView: React.FC<TextProps>
```

**Example:**

```typescript theme={null}
import { AdropProfileNameView } from 'adrop-ads-react-native'

<AdropProfileNameView style={{ fontSize: 14, fontWeight: '600' }} />
```

***

## AdropInterstitialAd

Class for managing interstitial ads.

### Constructor

```typescript theme={null}
constructor(unitId: string)
```

**Parameters:**

* `unitId` (string): Ad unit ID

### Properties

**isLoaded** (readonly)

```typescript theme={null}
get isLoaded(): boolean
```

Returns whether the ad is loaded.

**unitId** (readonly)

```typescript theme={null}
get unitId(): string
```

Returns the ad unit ID.

**creativeId** (readonly)

```typescript theme={null}
get creativeId(): string
```

Returns the creative ID.

**txId** (readonly)

```typescript theme={null}
get txId(): string
```

Returns the transaction ID.

**campaignId** (readonly)

```typescript theme={null}
get campaignId(): string
```

Returns the campaign ID.

**destinationURL** (readonly)

```typescript theme={null}
get destinationURL(): string
```

Returns the destination URL.

**browserTarget** (readonly)

```typescript theme={null}
get browserTarget(): BrowserTarget
```

Returns the browser target setting.

**listener**

```typescript theme={null}
listener?: AdropListener
```

Sets the ad event listener.

### Methods

**load()**

```typescript theme={null}
load(): void
```

Loads the ad.

**show()**

```typescript theme={null}
show(): void
```

Shows the ad.

**close()**

```typescript theme={null}
close(): void
```

Closes the ad programmatically.

**destroy()**

```typescript theme={null}
destroy(): void
```

Releases the ad instance.

**Example:**

```typescript theme={null}
import { AdropInterstitialAd } from 'adrop-ads-react-native'

const interstitialAd = new AdropInterstitialAd('YOUR_UNIT_ID')

interstitialAd.listener = {
  onAdReceived: (ad) => {
    console.log('Ad loaded')
    ad.show()
  },
  onAdFailedToReceive: (ad, errorCode) => {
    console.log('Ad failed to load', errorCode)
  },
}

interstitialAd.load()
```

***

## AdropRewardedAd

Class for managing rewarded ads.

### Constructor

```typescript theme={null}
constructor(unitId: string)
```

**Parameters:**

* `unitId` (string): Ad unit ID

### Properties

Same properties as AdropInterstitialAd.

### Methods

**load()**

```typescript theme={null}
load(): void
```

Loads the ad.

**show()**

```typescript theme={null}
show(): void
```

Shows the ad.

**close()**

```typescript theme={null}
close(): void
```

Closes the ad programmatically.

**destroy()**

```typescript theme={null}
destroy(): void
```

Releases the ad instance.

**setServerSideVerificationOptions()**

```typescript theme={null}
setServerSideVerificationOptions(options: ServerSideVerificationOptions): void
```

Sets options for server-side reward verification. Call before `load()`.

* `options.userId` (string, optional): User identifier sent in the server callback
* `options.customData` (string, optional): Custom data sent in the server callback

**Example:**

```typescript theme={null}
import { AdropRewardedAd } from 'adrop-ads-react-native'

const rewardedAd = new AdropRewardedAd('YOUR_UNIT_ID')

// Set server-side verification options
rewardedAd.setServerSideVerificationOptions({
  userId: 'user_12345',
  customData: 'extra_info',
})

rewardedAd.listener = {
  onAdReceived: (ad) => {
    console.log('Ad loaded')
    ad.show()
  },
  onAdEarnRewardHandler: (ad, type, amount) => {
    console.log(`Reward earned: type=${type}, amount=${amount}`)
  },
  onAdFailedToReceive: (ad, errorCode) => {
    console.log('Ad failed to load', errorCode)
  },
}

rewardedAd.load()
```

***

## AdropPopupAd

Class for managing popup ads.

### Constructor

```typescript theme={null}
constructor(
  unitId: string,
  colors?: AdropPopupAdColors,
  useCustomClick?: boolean
)
```

**Parameters:**

* `unitId` (string): Ad unit ID
* `colors` (AdropPopupAdColors, optional): Popup color customization
* `useCustomClick` (boolean, optional): Custom click handling (default: false)

### Properties

**isLoaded** (readonly)

```typescript theme={null}
get isLoaded(): boolean
```

Returns whether the ad is loaded.

**unitId** (readonly)

```typescript theme={null}
get unitId(): string
```

Returns the ad unit ID.

**creativeId** (readonly)

```typescript theme={null}
get creativeId(): string
```

Returns the creative ID.

**txId** (readonly)

```typescript theme={null}
get txId(): string
```

Returns the transaction ID.

**campaignId** (readonly)

```typescript theme={null}
get campaignId(): string
```

Returns the campaign ID.

**destinationURL** (readonly)

```typescript theme={null}
get destinationURL(): string
```

Returns the destination URL.

**browserTarget** (readonly)

```typescript theme={null}
get browserTarget(): BrowserTarget
```

Returns the browser target setting.

**listener**

```typescript theme={null}
listener?: AdropListener
```

Sets the ad event listener.

### Methods

**load()**

```typescript theme={null}
load(): void
```

Loads the ad.

**show()**

```typescript theme={null}
show(): void
```

Shows the ad.

**close()**

```typescript theme={null}
close(): void
```

Closes the popup ad.

**destroy()**

```typescript theme={null}
destroy(): void
```

Releases the ad instance.

### AdropPopupAdColors

```typescript theme={null}
type AdropPopupAdColors = {
  closeTextColor?: string
  hideForTodayTextColor?: string
  backgroundColor?: string
}
```

**Properties:**

* `closeTextColor` (string, optional): Close button text color
* `hideForTodayTextColor` (string, optional): 'Hide for today' text color
* `backgroundColor` (string, optional): Background color

***

## AdropListener

Listener interface for receiving ad events.

```typescript theme={null}
type AdropListener = {
  onAdReceived?: (ad: AdropAd) => void
  onAdClicked?: (ad: AdropAd) => void
  onAdImpression?: (ad: AdropAd) => void
  onAdFailedToReceive?: (ad: AdropAd, errorCode?: any) => void
  onAdDidPresentFullScreen?: (ad: AdropAd) => void
  onAdWillPresentFullScreen?: (ad: AdropAd) => void
  onAdDidDismissFullScreen?: (ad: AdropAd) => void
  onAdWillDismissFullScreen?: (ad: AdropAd) => void
  onAdFailedToShowFullScreen?: (ad: AdropAd, errorCode?: any) => void
  onAdEarnRewardHandler?: (ad: AdropAd, type: number, amount: number) => void
  onAdBackButtonPressed?: (ad: AdropAd) => void
  onAdVideoStart?: (ad: AdropAd) => void
  onAdVideoEnd?: (ad: AdropAd) => void
}
```

**Events:**

* `onAdReceived`: Ad reception complete
* `onAdClicked`: Ad clicked
* `onAdImpression`: Ad impression
* `onAdFailedToReceive`: Ad reception failed
* `onAdDidPresentFullScreen`: Full-screen ad presented
* `onAdWillPresentFullScreen`: Full-screen ad about to present
* `onAdDidDismissFullScreen`: Full-screen ad dismissed
* `onAdWillDismissFullScreen`: Full-screen ad about to dismiss
* `onAdFailedToShowFullScreen`: Full-screen ad failed to show
* `onAdEarnRewardHandler`: Reward earned (rewarded ads only)
* `onAdBackButtonPressed`: Back button pressed (Android only)
* `onAdVideoStart`: Video ad started playing
* `onAdVideoEnd`: Video ad finished playing

***

## useAdropInterstitialAd

Manages interstitial ads with a React Hook.

### Signature

```typescript theme={null}
function useAdropInterstitialAd(unitId: string | null): AdHookReturns & AdStates
```

**Parameters:**

* `unitId` (string | null): Ad unit ID

**Returns:**

* `load`: Ad load function
* `show`: Ad show function
* `reset`: State reset function
* `isBackPressed`: Back button pressed status (Android only)
* `isClicked`: Click status
* `isClosed`: Closed status
* `isEarnRewarded`: Whether the user has earned a reward
* `isLoaded`: Loaded status
* `isOpened`: Opened status
* `isReady`: Ready status
* `errorCode`: Error code
* `reward`: Reward info (`{ type: number, amount: number }` or `undefined`)
* `browserTarget`: Browser target setting (`BrowserTarget` or `undefined`)

**Example:**

```typescript theme={null}
import { useAdropInterstitialAd } from 'adrop-ads-react-native'

function MyComponent() {
  const { load, show, isLoaded, errorCode } = useAdropInterstitialAd('YOUR_UNIT_ID')

  useEffect(() => {
    load()
  }, [])

  useEffect(() => {
    if (isLoaded) {
      show()
    }
  }, [isLoaded])

  return <View />
}
```

***

## useAdropRewardedAd

Manages rewarded ads with a React Hook.

### Signature

```typescript theme={null}
function useAdropRewardedAd(unitId: string | null): AdHookReturns & AdStates
```

**Parameters:**

* `unitId` (string | null): Ad unit ID

**Returns:**

* `load`: Ad load function
* `show`: Ad show function
* `reset`: State reset function
* `isBackPressed`: Back button pressed status (Android only)
* `isClicked`: Click status
* `isClosed`: Closed status
* `isEarnRewarded`: Whether the user has earned a reward
* `isLoaded`: Loaded status
* `isOpened`: Opened status
* `isReady`: Ready status
* `errorCode`: Error code
* `reward`: Reward info (`{ type: number, amount: number }` or `undefined`)
* `browserTarget`: Browser target setting (`BrowserTarget` or `undefined`)

**Example:**

```typescript theme={null}
import { useAdropRewardedAd } from 'adrop-ads-react-native'

function MyComponent() {
  const { load, show, isLoaded, isEarnRewarded, reward } = useAdropRewardedAd('YOUR_UNIT_ID')

  useEffect(() => {
    load()
  }, [])

  useEffect(() => {
    if (isLoaded) {
      show()
    }
  }, [isLoaded])

  useEffect(() => {
    if (isEarnRewarded && reward) {
      console.log(`Reward: type=${reward.type}, amount=${reward.amount}`)
    }
  }, [isEarnRewarded, reward])

  return <View />
}
```

***

## useAdropWebView

Hook for registering a WebView with the Adrop SDK. Handles view tag resolution and registration automatically.

### Signature

```typescript theme={null}
function useAdropWebView(): {
  containerRef: React.RefObject<View>
  isReady: boolean
  onLayout: () => void
}
```

**Returns:**

* `containerRef`: Ref to attach to the `View` wrapping the WebView
* `isReady`: Whether the WebView has been successfully registered
* `onLayout`: Callback to trigger registration on layout

**Example:**

```typescript theme={null}
import { View } from 'react-native'
import { WebView } from 'react-native-webview'
import { useAdropWebView } from 'adrop-ads-react-native'

function WebViewScreen() {
  const { containerRef, isReady, onLayout } = useAdropWebView()

  return (
    <View ref={containerRef} style={{ flex: 1 }} onLayout={onLayout}>
      <WebView
        source={isReady ? { uri: 'https://your-website.com' } : { html: '' }}
        javaScriptEnabled={true}
        thirdPartyCookiesEnabled={true}
        mediaPlaybackRequiresUserAction={false}
        allowsInlineMediaPlayback={true}
      />
    </View>
  )
}
```

***

## AdropMetrics

Class for managing user attributes and events.

### setProperty

```typescript theme={null}
static setProperty(key: string, value: any): void
```

Sets a user property.

**Parameters:**

* `key` (string): Property key
* `value` (any): Property value

**Example:**

```typescript theme={null}
import { AdropMetrics, AdropProperties, AdropGender } from 'adrop-ads-react-native'

AdropMetrics.setProperty(AdropProperties.AGE, 25)
AdropMetrics.setProperty(AdropProperties.GENDER, AdropGender.MALE)
AdropMetrics.setProperty(AdropProperties.BIRTH, '1998-01-01')
```

### sendEvent

```typescript theme={null}
static sendEvent(name: string, params?: Record<string, any>): void
```

Sends a user behavior event. Supports nested `items` arrays for multi-item events.

**Parameters:**

* `name` (string): Event name (1–64 characters)
* `params` (Record\<string, any>, optional): Event parameters

**Example:**

```typescript theme={null}
import { AdropMetrics } from 'adrop-ads-react-native'

// Simple event
AdropMetrics.sendEvent('app_open')

// Event with parameters
AdropMetrics.sendEvent('view_item', {
  item_id: 'SKU-123',
  item_name: 'Widget',
  price: 29900,
})

// Multi-item event
AdropMetrics.sendEvent('purchase', {
  tx_id: 'TXN-001',
  currency: 'KRW',
  items: [
    { item_id: 'SKU-001', item_name: 'Product A', price: 29900, quantity: 1 },
    { item_id: 'SKU-002', item_name: 'Product B', price: 15000, quantity: 2 },
  ],
})
```

### logEvent (deprecated)

```typescript theme={null}
/** @deprecated Use sendEvent instead */
static logEvent(name: string, params?: Record<string, any>): void
```

Logs a custom event. Internally calls `sendEvent`.

**Parameters:**

* `name` (string): Event name
* `params` (object, optional): Event parameters

### properties

```typescript theme={null}
static properties(): Promise<Record<string, any>>
```

Gets all set properties.

**Returns:**

* Promise\<Record\<string, any>>: Property object

***

## AdropProperties

Enum defining user property keys.

```typescript theme={null}
enum AdropProperties {
  AGE = 'AGE',
  BIRTH = 'BIRTH',
  GENDER = 'GDR',
}
```

**Values:**

* `AGE`: Age
* `BIRTH`: Birth date
* `GENDER`: Gender

***

## AdropGender

Enum defining gender.

```typescript theme={null}
enum AdropGender {
  MALE = 'M',
  FEMALE = 'F',
  OTHER = 'O',
  UNKNOWN = 'U',
}
```

**Values:**

* `MALE`: Male
* `FEMALE`: Female
* `OTHER`: Other
* `UNKNOWN`: Unknown

***

## AdropConsent

Class for managing user consent (GDPR, CCPA, etc.).

### requestConsentInfoUpdate

```typescript theme={null}
static requestConsentInfoUpdate(): Promise<AdropConsentResult>
```

Updates consent information and shows the consent popup if needed.

**Returns:**

* `Promise<AdropConsentResult>`: Consent result

**Example:**

```typescript theme={null}
import { AdropConsent } from 'adrop-ads-react-native'

const result = await AdropConsent.requestConsentInfoUpdate()
console.log('Status:', result.status)
console.log('Can request ads:', result.canRequestAds)
console.log('Can show personalized ads:', result.canShowPersonalizedAds)
```

### getConsentStatus

```typescript theme={null}
static getConsentStatus(): Promise<AdropConsentStatus>
```

Gets the current consent status.

**Returns:**

* `Promise<AdropConsentStatus>`: Current consent status

**Example:**

```typescript theme={null}
const status = await AdropConsent.getConsentStatus()
```

### canRequestAds

```typescript theme={null}
static canRequestAds(): Promise<boolean>
```

Checks whether ads can be requested based on current consent.

**Returns:**

* `Promise<boolean>`: Whether ads can be requested

**Example:**

```typescript theme={null}
const canRequest = await AdropConsent.canRequestAds()
if (canRequest) {
  // Load ads
}
```

### reset

```typescript theme={null}
static reset(): void
```

Resets consent settings. For testing and debugging purposes.

**Example:**

```typescript theme={null}
AdropConsent.reset()
```

### setDebugSettings

```typescript theme={null}
static setDebugSettings(geography: AdropConsentDebugGeography): void
```

Sets debug geography for testing consent flows. Only works in DEBUG builds.

**Parameters:**

* `geography` (AdropConsentDebugGeography): Geography to simulate

**Example:**

```typescript theme={null}
import { AdropConsent, AdropConsentDebugGeography } from 'adrop-ads-react-native'

AdropConsent.setDebugSettings(AdropConsentDebugGeography.EEA)
```

***

## AdropConsentStatus

Enum representing user consent status.

```typescript theme={null}
enum AdropConsentStatus {
  UNKNOWN = 0,
  REQUIRED = 1,
  NOT_REQUIRED = 2,
  OBTAINED = 3,
}
```

**Values:**

* `UNKNOWN`: Not yet determined
* `REQUIRED`: Consent required (popup display needed)
* `NOT_REQUIRED`: Consent not required (not applicable region)
* `OBTAINED`: Consent obtained

***

## AdropConsentResult

Interface representing the result of a consent info update.

```typescript theme={null}
interface AdropConsentResult {
  status: AdropConsentStatus
  canRequestAds: boolean
  canShowPersonalizedAds: boolean
  error?: string
}
```

**Properties:**

* `status` (AdropConsentStatus): Consent status
* `canRequestAds` (boolean): Whether ads can be requested
* `canShowPersonalizedAds` (boolean): Whether personalized ads can be shown
* `error` (string, optional): Error message if any

***

## AdropConsentDebugGeography

Enum for specifying debug geography in consent testing.

```typescript theme={null}
enum AdropConsentDebugGeography {
  DISABLED = 0,
  EEA = 1,
  NOT_EEA = 2, // deprecated - use OTHER instead
  REGULATED_US_STATE = 3,
  OTHER = 4,
}
```

**Values:**

* `DISABLED`: No debug setting (use actual location)
* `EEA`: European Economic Area (GDPR applies)
* `NOT_EEA`: *(deprecated - use `OTHER` instead)*
* `REGULATED_US_STATE`: Regulated US states (California, etc., CCPA applies)
* `OTHER`: Unregulated region

***

## Deprecated APIs

The following APIs are deprecated and will be removed in future versions. Migrate to the recommended alternatives.

### AdropAd.destinationUrl

<Warning>
  `destinationUrl` is deprecated. Use `destinationURL` instead.
</Warning>

```typescript theme={null}
// Before (deprecated)
const url = ad.destinationUrl

// After
const url = ad.destinationURL
```

### AdropPopupAd.createIds()

<Warning>
  `createIds()` is deprecated. Use `creativeId` instead.
</Warning>

```typescript theme={null}
// Before (deprecated)
const ids = popupAd.createIds()

// After
const id = popupAd.creativeId
```

### AdropNativeAd.requestId

<Warning>
  `AdropNativeAd.requestId` is deprecated and always returns an empty string. This property will be removed in future versions.
</Warning>

```typescript theme={null}
// Before (deprecated)
const reqId = nativeAd.requestId // always returns ''

// After - remove usage of requestId
```

### AdropMetrics.logEvent()

<Warning>
  `logEvent()` is deprecated. Use `sendEvent()` instead.
</Warning>

```typescript theme={null}
// Before (deprecated)
AdropMetrics.logEvent('purchase', { item_id: 'SKU-001' })

// After
AdropMetrics.sendEvent('purchase', { item_id: 'SKU-001' })
```
