Adrop
Class for initializing the Adrop SDK and managing global settings.initialize
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)
setUID
uid(string): Unique user identifier
setTheme
theme(AdropTheme): Theme value (‘light’, ‘dark’, ‘auto’)
registerWebView
viewTag(number): Native view tag obtained viafindNodeHandle()from theViewwrapping the WebView
AdropTheme
Constant object for specifying app theme.light: Light themedark: Dark themeauto: Follow system setting
BrowserTarget
Enum for specifying how ad destination URLs should be opened.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.network: Network errorinternal: Internal errorinitialize: SDK initialization errorinvalidUnit: Invalid ad unitnotTargetCountry: Not a target countryinactive: Deactivated adadNoFill: No ad availableadDuplicated: Duplicate ad load requestadLoading: Ad is loadingadEmpty: Ad is emptyadShown: Ad already shownadHideForToday: Ad hidden for todayadLandscapeUnsupported: Landscape mode not supportedbackfillNoFill: Backfill ad not availableundefined: Undefined error
AdropAdChoicesPosition
Enum for setting the AdChoices badge position on backfill native ads.Definition
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
AdropBanner
React component for displaying banner ads.Props
style(object, required): Banner style (including height and width)unitId(string, required): Ad unit IDuseCustomClick(boolean, optional): Custom click handling (default: false)adSize(object, optional): Ad size settingautoLoad(boolean, optional): Auto load (default: true)onAdReceived(function, optional): Called on ad receptiononAdImpression(function, optional): Called on ad impressiononAdClicked(function, optional): Called on ad clickonAdFailedToReceive(function, optional): Called on ad reception failureonAdVideoStart(function, optional): Called when a video ad starts playingonAdVideoEnd(function, optional): Called when a video ad finishes playing
Methods
load()AdropBannerMetadata
AdropNativeAd
Class for managing native ads.Constructor
| 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)Methods
load()AdropNativeProperties
AdropNativeProfile
AdropNativeAdListener
AdropNativeAdView
Container component for displaying native ads.Props
nativeAd(AdropNativeAd, optional): Native ad instance- …ViewProps: All React Native View props
Native Ad View Components
Components for displaying each element of a native ad. All components must be used insideAdropNativeAdView.
AdropIconView
Displays the ad icon.AdropHeadLineView
Displays the ad headline.AdropBodyView
Displays the ad body text.AdropMediaView
Displays the ad media (image/video).AdropCallToActionView
Displays the ad CTA (Call To Action) button.AdropAdvertiserView
Displays the advertiser information.AdropProfileLogoView
Displays the profile logo.AdropProfileNameView
Displays the profile name.AdropInterstitialAd
Class for managing interstitial ads.Constructor
unitId(string): Ad unit ID
Properties
isLoaded (readonly)Methods
load()AdropRewardedAd
Class for managing rewarded ads.Constructor
unitId(string): Ad unit ID
Properties
Same properties as AdropInterstitialAd.Methods
load()load().
options.userId(string, optional): User identifier sent in the server callbackoptions.customData(string, optional): Custom data sent in the server callback
AdropPopupAd
Class for managing popup ads.Constructor
unitId(string): Ad unit IDcolors(AdropPopupAdColors, optional): Popup color customizationuseCustomClick(boolean, optional): Custom click handling (default: false)
Properties
isLoaded (readonly)Methods
load()AdropPopupAdColors
closeTextColor(string, optional): Close button text colorhideForTodayTextColor(string, optional): ‘Hide for today’ text colorbackgroundColor(string, optional): Background color
AdropListener
Listener interface for receiving ad events.onAdReceived: Ad reception completeonAdClicked: Ad clickedonAdImpression: Ad impressiononAdFailedToReceive: Ad reception failedonAdDidPresentFullScreen: Full-screen ad presentedonAdWillPresentFullScreen: Full-screen ad about to presentonAdDidDismissFullScreen: Full-screen ad dismissedonAdWillDismissFullScreen: Full-screen ad about to dismissonAdFailedToShowFullScreen: Full-screen ad failed to showonAdEarnRewardHandler: Reward earned (rewarded ads only)onAdBackButtonPressed: Back button pressed (Android only)onAdVideoStart: Video ad started playingonAdVideoEnd: Video ad finished playing
useAdropInterstitialAd
Manages interstitial ads with a React Hook.Signature
unitId(string | null): Ad unit ID
load: Ad load functionshow: Ad show functionreset: State reset functionisBackPressed: Back button pressed status (Android only)isClicked: Click statusisClosed: Closed statusisEarnRewarded: Whether the user has earned a rewardisLoaded: Loaded statusisOpened: Opened statusisReady: Ready statuserrorCode: Error codereward: Reward info ({ type: number, amount: number }orundefined)browserTarget: Browser target setting (BrowserTargetorundefined)
useAdropRewardedAd
Manages rewarded ads with a React Hook.Signature
unitId(string | null): Ad unit ID
load: Ad load functionshow: Ad show functionreset: State reset functionisBackPressed: Back button pressed status (Android only)isClicked: Click statusisClosed: Closed statusisEarnRewarded: Whether the user has earned a rewardisLoaded: Loaded statusisOpened: Opened statusisReady: Ready statuserrorCode: Error codereward: Reward info ({ type: number, amount: number }orundefined)browserTarget: Browser target setting (BrowserTargetorundefined)
useAdropWebView
Hook for registering a WebView with the Adrop SDK. Handles view tag resolution and registration automatically.Signature
containerRef: Ref to attach to theViewwrapping the WebViewisReady: Whether the WebView has been successfully registeredonLayout: Callback to trigger registration on layout
AdropMetrics
Class for managing user attributes and events.setProperty
key(string): Property keyvalue(any): Property value
sendEvent
items arrays for multi-item events.
Parameters:
name(string): Event name (1–64 characters)params(Record<string, any>, optional): Event parameters
logEvent (deprecated)
sendEvent.
Parameters:
name(string): Event nameparams(object, optional): Event parameters
properties
- Promise<Record<string, any>>: Property object
AdropProperties
Enum defining user property keys.AGE: AgeBIRTH: Birth dateGENDER: Gender
AdropGender
Enum defining gender.MALE: MaleFEMALE: FemaleOTHER: OtherUNKNOWN: Unknown
AdropConsent
Class for managing user consent (GDPR, CCPA, etc.).requestConsentInfoUpdate
Promise<AdropConsentResult>: Consent result
getConsentStatus
Promise<AdropConsentStatus>: Current consent status
canRequestAds
Promise<boolean>: Whether ads can be requested
reset
setDebugSettings
geography(AdropConsentDebugGeography): Geography to simulate
AdropConsentStatus
Enum representing user consent status.UNKNOWN: Not yet determinedREQUIRED: 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.status(AdropConsentStatus): Consent statuscanRequestAds(boolean): Whether ads can be requestedcanShowPersonalizedAds(boolean): Whether personalized ads can be shownerror(string, optional): Error message if any
AdropConsentDebugGeography
Enum for specifying debug geography in consent testing.DISABLED: No debug setting (use actual location)EEA: European Economic Area (GDPR applies)NOT_EEA: (deprecated - useOTHERinstead)REGULATED_US_STATE: Regulated US states (California, etc., CCPA applies)OTHER: Unregulated region