Classes
Adrop
The main class of the SDK. Manages SDK initialization and global settings.Static Methods
| Method | Return Type | Description |
|---|---|---|
initialize(production:useInAppBrowser:targetCountries:) | void | Initialize SDK |
setUID(_:) | void | Set user identifier |
setTheme(_:) | void | Set app theme |
handleDeepLink(url:) | Bool | Handle deep link |
openQuest(channel:path:) | @discardableResult Bool | Open Quest screen |
registerWebView(_:) | void | Register a WKWebView for backfill ads |
Static Properties
| Property | Type | Description |
|---|---|---|
sdkVersion | String | SDK version (read-only) |
consentManager | AdropConsentManager? | Consent manager (automatically set when AdropAdsBackfill is installed, read/write) |
Initialize Method
Production mode. Set to
true when deployingWhether to use in-app browser. If
true, ad clicks open within the appArray of target country codes (e.g., [“KR”, “US”]).
nil for all countriesSet User Identifier
Unique ID to identify the user (max 100 characters)
Set Theme
App theme (light, dark, auto)
AdropBanner
Class for displaying banner ads. Inherits fromUIView.
Initialization
Banner ad unit ID created in the Ad Control Console
Contextual targeting ID (default: empty string)
Methods
| Method | Return Type | Description |
|---|---|---|
load() | void | Request and load ad |
open(_:useInAppBrowser:) | void | Open URL (defaults to destinationURL) |
Properties
| Property | Type | Description |
|---|---|---|
unitId | String | Unit ID (read-only) |
contextId | String | Contextual targeting ID (read-only, set via init) |
creativeSize | CGSize | Ad creative size (read-only, defaults to zero) |
destinationURL | String? | Ad destination URL (read-only) |
txId | String | Transaction ID (read-only) |
campaignId | String | Campaign ID (read-only) |
creativeId | String | Creative ID (read-only) |
isBackfilled | Bool | Whether the ad is a backfill ad (read-only) |
useCustomClick | Bool | Whether to use custom click handling (read/write) |
browserTarget | BrowserTarget? | How to open URLs on ad click (read-only) |
delegate | AdropBannerDelegate? | Delegate (read/write) |
onAdReceived | ((AdropBanner) -> Void)? | Closure callback for ad received |
onAdFailedToReceive | ((AdropBanner, AdropErrorCode) -> Void)? | Closure callback for ad failed |
onAdImpression | ((AdropBanner) -> Void)? | Closure callback for ad impression |
onAdClicked | ((AdropBanner) -> Void)? | Closure callback for ad clicked |
AdropNativeAd
Class for managing native ad data.Initialization
Native ad unit ID created in the Ad Control Console
Contextual targeting ID (default: empty string)
Methods
| Method | Return Type | Description |
|---|---|---|
load() | void | Request and load ad |
open(_:useInAppBrowser:) | void | Open URL (defaults to destinationURL) |
Properties
| Property | Type | Description |
|---|---|---|
unitId | String | Unit ID (read-only) |
contextId | String | Contextual targeting ID (read-only, set via init) |
txId | String | Transaction ID (read-only) |
campaignId | String | Campaign ID (read-only) |
creativeId | String | Creative ID (read-only) |
isLoaded | Bool | Whether ad is loaded (read-only) |
isBackfilled | Bool | Whether the ad is a backfill ad (read-only) |
headline | String | Ad headline (read-only) |
body | String | Ad body text (read-only) |
callToAction | String | CTA button text (read-only) |
icon | String | Ad icon URL (read-only) |
cover | String | Ad cover image URL (read-only) |
asset | String | Main image URL (read-only) |
creative | String | HTML creative content (read-only) |
advertiser | String | Advertiser name (read-only) |
advertiserURL | String | Advertiser URL (read-only) |
profile | AdropNativeAdProfile | Advertiser profile (read-only) |
extra | [String: String] | Additional text fields (read-only) |
accountTag | [String: Any] | Account tag data (read-only) |
creativeTag | [String: Any] | Creative tag data (read-only) |
creativeSize | CGSize | Ad creative size (read-only, defaults to zero) |
destinationURL | String? | Ad destination URL (read-only) |
useCustomClick | Bool | Whether to use custom click handling (read/write) |
browserTarget | BrowserTarget? | How to open URLs on ad click (read-only) |
delegate | AdropNativeAdDelegate? | Delegate (read/write) |
onAdReceived | ((AdropNativeAd) -> Void)? | Closure callback for ad received |
onAdFailedToReceive | ((AdropNativeAd, AdropErrorCode) -> Void)? | Closure callback for ad failed |
onAdImpression | ((AdropNativeAd) -> Void)? | Closure callback for ad impression |
onAdClicked | ((AdropNativeAd) -> Void)? | Closure callback for ad clicked |
AdropInterstitialAd
Class for displaying interstitial ads.Initialization
Interstitial ad unit ID created in the Ad Control Console
Methods
| Method | Return Type | Description |
|---|---|---|
load() | void | Preload ad |
show(fromRootViewController:) | void | Display ad |
show Method
Root view controller to present the ad from
Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropInterstitialAdDelegate? | Delegate (read/write) |
isLoaded | Bool | Whether ad is loaded (read-only) |
unitId | String | Unit ID (read-only) |
txId | String | Transaction ID (read-only) |
campaignId | String | Campaign ID (read-only) |
creativeId | String | Creative ID (read-only) |
isBackfilled | Bool | Whether the ad is a backfill ad (read-only) |
destinationURL | String | Ad destination URL (read-only) |
browserTarget | BrowserTarget? | How to open URLs on ad click (read-only) |
onAdReceived | ((AdropInterstitialAd) -> Void)? | Closure callback for ad received |
onAdFailedToReceive | ((AdropInterstitialAd, AdropErrorCode) -> Void)? | Closure callback for ad failed |
onAdImpression | ((AdropInterstitialAd) -> Void)? | Closure callback for ad impression |
onAdClicked | ((AdropInterstitialAd) -> Void)? | Closure callback for ad clicked |
onAdWillPresentFullScreen | ((AdropInterstitialAd) -> Void)? | Closure callback before presenting |
onAdDidPresentFullScreen | ((AdropInterstitialAd) -> Void)? | Closure callback after presenting |
onAdWillDismissFullScreen | ((AdropInterstitialAd) -> Void)? | Closure callback before dismissing |
onAdDidDismissFullScreen | ((AdropInterstitialAd) -> Void)? | Closure callback after dismissing |
onAdFailedToShowFullScreen | ((AdropInterstitialAd, AdropErrorCode) -> Void)? | Closure callback for show failure |
AdropRewardedAd
Class for displaying rewarded ads.Initialization
Rewarded ad unit ID created in the Ad Control Console
Methods
| Method | Return Type | Description |
|---|---|---|
load() | void | Preload ad |
show(fromRootViewController:userDidEarnRewardHandler:) | void | Display ad and set reward handler |
show Method
Root view controller to present the ad from
Closure called when user earns a reward.
type is the reward type and amount is the reward amount set in Ad Control Console.Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropRewardedAdDelegate? | Delegate (read/write) |
isLoaded | Bool | Whether ad is loaded (read-only) |
unitId | String | Unit ID (read-only) |
txId | String | Transaction ID (read-only) |
campaignId | String | Campaign ID (read-only) |
creativeId | String | Creative ID (read-only) |
isBackfilled | Bool | Whether the ad is a backfill ad (read-only) |
destinationURL | String | Ad destination URL (read-only) |
browserTarget | BrowserTarget? | How to open URLs on ad click (read-only) |
serverSideVerificationOptions | AdropServerSideVerificationOptions? | Server-side verification options (read/write) |
onAdReceived | ((AdropRewardedAd) -> Void)? | Closure callback for ad received |
onAdFailedToReceive | ((AdropRewardedAd, AdropErrorCode) -> Void)? | Closure callback for ad failed |
onAdImpression | ((AdropRewardedAd) -> Void)? | Closure callback for ad impression |
onAdClicked | ((AdropRewardedAd) -> Void)? | Closure callback for ad clicked |
onAdWillPresentFullScreen | ((AdropRewardedAd) -> Void)? | Closure callback before presenting |
onAdDidPresentFullScreen | ((AdropRewardedAd) -> Void)? | Closure callback after presenting |
onAdWillDismissFullScreen | ((AdropRewardedAd) -> Void)? | Closure callback before dismissing |
onAdDidDismissFullScreen | ((AdropRewardedAd) -> Void)? | Closure callback after dismissing |
onAdFailedToShowFullScreen | ((AdropRewardedAd, AdropErrorCode) -> Void)? | Closure callback for show failure |
AdropPopupAd
Class for displaying popup ads.Initialization
Popup ad unit ID created in the Ad Control Console
Methods
| Method | Return Type | Description |
|---|---|---|
load() | void | Preload ad |
show(fromRootViewController:) | void | Display ad |
close() | void | Close ad |
open(_:useInAppBrowser:) | void | Open URL (defaults to destinationURL) |
show Method
Root view controller to present the ad from
Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropPopupAdDelegate? | Ad event delegate (read/write) |
closeDelegate | AdropPopupAdCloseDelegate? | Close event delegate (read/write) |
isLoaded | Bool | Whether ad is loaded (read-only) |
unitId | String | Unit ID (read-only) |
txId | String | Current transaction ID (read-only) |
txIds | [String] | All transaction IDs (read-only) |
campaignId | String | Current campaign ID (read-only) |
campaignIds | [String] | All campaign IDs (read-only) |
creativeId | String? | Current creative ID (read-only) |
creativeIds | [String] | All creative IDs (read-only) |
destinationURL | String? | Ad destination URL (read-only) |
useCustomClick | Bool | Whether to use custom click handling (read/write) |
browserTarget | BrowserTarget? | How to open URLs on ad click (read-only) |
backgroundColor | UIColor? | Popup background color (read/write) |
hideForTodayTextColor | UIColor? | ”Don’t show today” text color (read/write) |
closeTextColor | UIColor? | Close button text color (read/write) |
ctaTextColor | UIColor? | CTA text color (read/write) |
onAdReceived | ((AdropPopupAd) -> Void)? | Closure callback for ad received |
onAdFailedToReceive | ((AdropPopupAd, AdropErrorCode) -> Void)? | Closure callback for ad failed |
onAdImpression | ((AdropPopupAd) -> Void)? | Closure callback for ad impression |
onAdClicked | ((AdropPopupAd) -> Void)? | Closure callback for ad clicked |
onAdWillPresentFullScreen | ((AdropPopupAd) -> Void)? | Closure callback before presenting |
onAdDidPresentFullScreen | ((AdropPopupAd) -> Void)? | Closure callback after presenting |
onAdWillDismissFullScreen | ((AdropPopupAd) -> Void)? | Closure callback before dismissing |
onAdDidDismissFullScreen | ((AdropPopupAd) -> Void)? | Closure callback after dismissing |
onAdFailedToShowFullScreen | ((AdropPopupAd, AdropErrorCode) -> Void)? | Closure callback for show failure |
onClosed | ((AdropPopupAd) -> Void)? | Closure callback for close button |
onDimClicked | ((AdropPopupAd) -> Void)? | Closure callback for dim area click |
onTodayOffClicked | ((AdropPopupAd) -> Void)? | Closure callback for “Don’t show today” |
AdropSplashAd
Class for managing splash ads.AdropSplashAd cannot be instantiated directly (the initializer is internal). Use AdropSplashAdViewController or AdropSplashAdView to display splash ads.Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropSplashAdDelegate? | Delegate (read/write) |
unitId | String | Unit ID (read-only) |
txId | String | Transaction ID (read-only) |
campaignId | String | Campaign ID (read-only) |
creativeId | String | Creative ID (read-only) |
destinationURL | String | Ad destination URL (read-only) |
readyToShow | Bool | Whether the ad is ready to display (read-only) |
adImage | UIImage? | Cached ad image (read-only) |
AdropSplashAdViewController
View controller for displaying splash ads in full screen.Initialization
Splash ad unit ID created in the Ad Control Console
Ad request timeout in seconds
Methods
| Method | Return Type | Description |
|---|---|---|
close() | void | Close the splash ad and transition to mainViewController |
Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropSplashAdDelegate? | Delegate (read/write) |
splashAd | AdropSplashAd | Underlying splash ad object (read-only) |
displayDuration | TimeInterval | Ad display duration (default: 1 second, deprecated — set in console) |
logoImage | UIImage? | Logo image to display at bottom (read/write) |
backgroundColor | UIColor? | Background color (read/write) |
mainViewController | UIViewController? | Main view controller to transition to after splash ad closes (read/write) |
AdropSplashAdView
View for displaying splash ads. Inherits fromUIImageView.
Initialization
Splash ad unit ID created in the Ad Control Console
Ad request timeout in seconds
Loading happens automatically on initialization. Do not call
load() directly.Properties
| Property | Type | Description |
|---|---|---|
delegate | AdropSplashAdViewDelegate? | Delegate (read/write) |
ad | AdropSplashAd | Underlying splash ad object (read-only) |
unitId | String | Unit ID (read-only) |
txId | String? | Transaction ID (read-only) |
creativeId | String | Creative ID (read-only) |
isClosed | Bool | Whether the splash ad has closed (read-only) |
displayDuration | TimeInterval | Ad display duration (deprecated — set in console) |
AdropMetrics
Class for managing user properties and events.Static Properties
| Property | Type | Description |
|---|---|---|
userDataConsent | Bool | User data consent status (default: true, read-only) |
Static Methods
| Method | Return Type | Description |
|---|---|---|
setUserDataConsent(_:) | void | Set user data collection consent (true = consent, false = no consent). When set to false, data is stored locally but not sent to the server. |
setProperty(key:value:) | void | Set user property |
sendEvent(name:params:) | void | Send user event |
logEvent(name:params:) | void | Deprecated. Use sendEvent instead. |
Set User Property
Property key (max 64 characters)
Property value (supports String, Int, Double, Bool)
Send Event
Event name (1–64 characters)
Event parameters dictionary. Keys max 64 characters, string values max 1024 characters.
- 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().
Log Event (Deprecated)
Protocols (Delegates)
AdropBannerDelegate
Protocol for handling banner ad lifecycle events.Required Methods
Optional Methods
AdropNativeAdDelegate
Protocol for handling native ad lifecycle events.Required Methods
Optional Methods
AdropInterstitialAdDelegate
Protocol for handling interstitial ad lifecycle events.Required Methods
Optional Methods
AdropRewardedAdDelegate
Protocol for handling rewarded ad lifecycle events.Required Methods
Optional Methods
AdropPopupAdDelegate
Protocol for handling popup ad lifecycle events.Required Methods
Optional Methods
AdropPopupAdCloseDelegate
Protocol for handling popup ad close events.Optional Methods
AdropSplashAdDelegate
Protocol for handling splash ad lifecycle events. All methods are@objc optional.
Optional Methods
impressed indicates whether the ad was fully displayed.
AdropSplashAdViewDelegate
Protocol for handling splash ad view lifecycle events.Required Methods
impressed indicates whether the ad was fully displayed.
Optional Methods
UseCustomClick
Protocol for handling custom ad click behavior. Implemented byAdropBanner, AdropNativeAd, and AdropPopupAd.
| Property / Method | Type | Description |
|---|---|---|
destinationURL | String? | The destination URL of the ad (read-only) |
useCustomClick | Bool | When true, disables automatic URL opening on ad click |
open(_:useInAppBrowser:) | Method | Opens a URL manually. Call this in click callback when useCustomClick is true |
Enums
AdropErrorCode
Error codes that can occur during ad loading and display.| Case | Code Value | Description |
|---|---|---|
ERROR_CODE_NETWORK | 0 | Network error |
ERROR_CODE_INTERNAL | 1 | Internal error |
ERROR_CODE_INITIALIZE | 2 | SDK initialization failed |
ERROR_CODE_INVALID_UNIT | 3 | Invalid unit ID |
ERROR_CODE_NOT_TARGET_COUNTRY | 4 | Not a target country |
ERROR_CODE_AD_INACTIVE | 5 | No active campaigns |
ERROR_CODE_AD_NO_FILL | 6 | No ads available to display |
ERROR_CODE_AD_LOAD_DUPLICATED | 7 | Duplicate ad load request |
ERROR_CODE_AD_LOADING | 8 | Ad is loading |
ERROR_CODE_AD_EMPTY | 9 | Ad not loaded |
ERROR_CODE_AD_SHOWN | 10 | Ad already shown |
ERROR_CODE_AD_HIDE_FOR_TODAY | 11 | ”Don’t show today” is set |
ERROR_CODE_ACCOUNT_USAGE_LIMIT_EXCEEDED | 12 | Account usage limit exceeded |
ERROR_CODE_LANDSCAPE_UNSUPPORTED | 13 | Landscape mode not supported |
ERROR_CODE_AD_BACKFILL_NO_FILL | 14 | No backfill ads available |
Error Code Descriptions
Network RelatedERROR_CODE_NETWORK: Network connection error occurred. Check internet connection.
ERROR_CODE_INITIALIZE: SDK is not initialized. CallAdrop.initialize()first.
ERROR_CODE_INVALID_UNIT: Invalid unit ID. Verify in the console.ERROR_CODE_NOT_TARGET_COUNTRY: Current user’s country is not a target country.
ERROR_CODE_AD_INACTIVE: No active campaigns for this unit.ERROR_CODE_AD_NO_FILL: No ads available to display.ERROR_CODE_AD_BACKFILL_NO_FILL: No backfill ads available either.
ERROR_CODE_AD_LOAD_DUPLICATED: Already loading an ad.ERROR_CODE_AD_LOADING: Ad is still loading.ERROR_CODE_AD_EMPTY: Must load ad before displaying.ERROR_CODE_AD_SHOWN: Ad already shown. Load a new ad.ERROR_CODE_AD_HIDE_FOR_TODAY: User selected “Don’t show today”.
ERROR_CODE_INTERNAL: Internal error occurred.ERROR_CODE_ACCOUNT_USAGE_LIMIT_EXCEEDED: Account ad usage limit exceeded.ERROR_CODE_LANDSCAPE_UNSUPPORTED: This ad does not support landscape mode.
AdropTheme
Enum representing app theme settings.| Case | Description |
|---|---|
light | Light mode |
dark | Dark mode |
auto | Follow system setting (default) |
BrowserTarget
Controls how ad URLs are opened.| Value | Description |
|---|---|
EXTERNAL | Opens URL in the default external browser (default) |
INTERNAL | Opens URL in an in-app browser |
Structs and Types
AdropNativeAdProfile
Struct containing advertiser profile information.AdropServerSideVerificationOptions
Class for setting server-side verification options for rewarded ads.| Property | Type | Description |
|---|---|---|
userId | String? | User identifier for server-side verification |
customData | String? | Custom data string to include in the server callback |
Constants
AdropUnitId
Test unit ID constants.Additional Resources
Banner Ads
Banner ad implementation guide
Native Ads
Native ad implementation guide
Interstitial Ads
Interstitial ad implementation guide
Rewarded Ads
Rewarded ad implementation guide