Skip to main content

Classes

Adrop

The main class of the SDK. Manages SDK initialization and global settings.

Static Methods

MethodReturn TypeDescription
initialize(production:useInAppBrowser:targetCountries:)voidInitialize SDK
setUID(_:)voidSet user identifier
setTheme(_:)voidSet app theme
handleDeepLink(url:)BoolHandle deep link
openQuest(channel:path:)@discardableResult BoolOpen Quest screen
registerWebView(_:)voidRegister a WKWebView for backfill ads

Static Properties

PropertyTypeDescription
sdkVersionStringSDK version (read-only)
consentManagerAdropConsentManager?Consent manager (automatically set when AdropAdsBackfill is installed, read/write)

Initialize Method

static func initialize(
    production: Bool = false,
    useInAppBrowser: Bool = false,
    targetCountries: [String]? = nil
)
production
Bool
default:"false"
Production mode. Set to true when deploying
useInAppBrowser
Bool
default:"false"
Whether to use in-app browser. If true, ad clicks open within the app
targetCountries
[String]?
default:"nil"
Array of target country codes (e.g., [“KR”, “US”]). nil for all countries
Usage Example:
// AppDelegate.swift
func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    Adrop.initialize(production: false)
    return true
}

Set User Identifier

static func setUID(_ uid: String)
uid
String
required
Unique ID to identify the user (max 100 characters)
Usage Example:
Adrop.setUID("user_12345")

Set Theme

static func setTheme(_ theme: AdropTheme)
theme
AdropTheme
required
App theme (light, dark, auto)
Usage Example:
Adrop.setTheme(.dark)

AdropBanner

Class for displaying banner ads. Inherits from UIView.

Initialization

init(unitId: String, contextId: String = "")
unitId
String
required
Banner ad unit ID created in the Ad Control Console
contextId
String
Contextual targeting ID (default: empty string)

Methods

MethodReturn TypeDescription
load()voidRequest and load ad
open(_:useInAppBrowser:)voidOpen URL (defaults to destinationURL)

Properties

PropertyTypeDescription
unitIdStringUnit ID (read-only)
contextIdStringContextual targeting ID (read-only, set via init)
creativeSizeCGSizeAd creative size (read-only, defaults to zero)
destinationURLString?Ad destination URL (read-only)
txIdStringTransaction ID (read-only)
campaignIdStringCampaign ID (read-only)
creativeIdStringCreative ID (read-only)
isBackfilledBoolWhether the ad is a backfill ad (read-only)
useCustomClickBoolWhether to use custom click handling (read/write)
browserTargetBrowserTarget?How to open URLs on ad click (read-only)
delegateAdropBannerDelegate?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
Usage Example:
let banner = AdropBanner(unitId: "YOUR_UNIT_ID", contextId: "article_123")
banner.delegate = self
banner.load()

AdropNativeAd

Class for managing native ad data.

Initialization

init(unitId: String, contextId: String = "")
unitId
String
required
Native ad unit ID created in the Ad Control Console
contextId
String
Contextual targeting ID (default: empty string)

Methods

MethodReturn TypeDescription
load()voidRequest and load ad
open(_:useInAppBrowser:)voidOpen URL (defaults to destinationURL)

Properties

PropertyTypeDescription
unitIdStringUnit ID (read-only)
contextIdStringContextual targeting ID (read-only, set via init)
txIdStringTransaction ID (read-only)
campaignIdStringCampaign ID (read-only)
creativeIdStringCreative ID (read-only)
isLoadedBoolWhether ad is loaded (read-only)
isBackfilledBoolWhether the ad is a backfill ad (read-only)
headlineStringAd headline (read-only)
bodyStringAd body text (read-only)
callToActionStringCTA button text (read-only)
iconStringAd icon URL (read-only)
coverStringAd cover image URL (read-only)
assetStringMain image URL (read-only)
creativeStringHTML creative content (read-only)
advertiserStringAdvertiser name (read-only)
advertiserURLStringAdvertiser URL (read-only)
profileAdropNativeAdProfileAdvertiser 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)
creativeSizeCGSizeAd creative size (read-only, defaults to zero)
destinationURLString?Ad destination URL (read-only)
useCustomClickBoolWhether to use custom click handling (read/write)
browserTargetBrowserTarget?How to open URLs on ad click (read-only)
delegateAdropNativeAdDelegate?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
Usage Example:
let nativeAd = AdropNativeAd(unitId: "YOUR_UNIT_ID")
nativeAd.delegate = self
nativeAd.load()

// After ad loads
titleLabel.text = nativeAd.headline
bodyLabel.text = nativeAd.body
ctaButton.setTitle(nativeAd.callToAction, for: .normal)

AdropInterstitialAd

Class for displaying interstitial ads.

Initialization

init(unitId: String)
unitId
String
required
Interstitial ad unit ID created in the Ad Control Console

Methods

MethodReturn TypeDescription
load()voidPreload ad
show(fromRootViewController:)voidDisplay ad
show Method
func show(fromRootViewController viewController: UIViewController)
viewController
UIViewController
required
Root view controller to present the ad from

Properties

PropertyTypeDescription
delegateAdropInterstitialAdDelegate?Delegate (read/write)
isLoadedBoolWhether ad is loaded (read-only)
unitIdStringUnit ID (read-only)
txIdStringTransaction ID (read-only)
campaignIdStringCampaign ID (read-only)
creativeIdStringCreative ID (read-only)
isBackfilledBoolWhether the ad is a backfill ad (read-only)
destinationURLStringAd destination URL (read-only)
browserTargetBrowserTarget?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
Usage Example:
let interstitial = AdropInterstitialAd(unitId: "YOUR_UNIT_ID")
interstitial.delegate = self
interstitial.load()

// After ad loads
if interstitial.isLoaded {
    interstitial.show(fromRootViewController: self)
}

AdropRewardedAd

Class for displaying rewarded ads.

Initialization

init(unitId: String)
unitId
String
required
Rewarded ad unit ID created in the Ad Control Console

Methods

MethodReturn TypeDescription
load()voidPreload ad
show(fromRootViewController:userDidEarnRewardHandler:)voidDisplay ad and set reward handler
show Method
func show(
    fromRootViewController viewController: UIViewController,
    userDidEarnRewardHandler: @escaping (_ type: Int, _ amount: Int) -> Void
)
viewController
UIViewController
required
Root view controller to present the ad from
userDidEarnRewardHandler
(_ type: Int, _ amount: Int) -> Void
required
Closure called when user earns a reward. type is the reward type and amount is the reward amount set in Ad Control Console.

Properties

PropertyTypeDescription
delegateAdropRewardedAdDelegate?Delegate (read/write)
isLoadedBoolWhether ad is loaded (read-only)
unitIdStringUnit ID (read-only)
txIdStringTransaction ID (read-only)
campaignIdStringCampaign ID (read-only)
creativeIdStringCreative ID (read-only)
isBackfilledBoolWhether the ad is a backfill ad (read-only)
destinationURLStringAd destination URL (read-only)
browserTargetBrowserTarget?How to open URLs on ad click (read-only)
serverSideVerificationOptionsAdropServerSideVerificationOptions?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
Usage Example:
let rewardedAd = AdropRewardedAd(unitId: "YOUR_UNIT_ID")
rewardedAd.delegate = self
rewardedAd.load()

// After ad loads
if rewardedAd.isLoaded {
    rewardedAd.show(fromRootViewController: self) { type, amount in
        print("User earned a reward! type: \(type), amount: \(amount)")
        // Grant reward logic
    }
}

AdropPopupAd

Class for displaying popup ads.

Initialization

init(unitId: String)
unitId
String
required
Popup ad unit ID created in the Ad Control Console

Methods

MethodReturn TypeDescription
load()voidPreload ad
show(fromRootViewController:)voidDisplay ad
close()voidClose ad
open(_:useInAppBrowser:)voidOpen URL (defaults to destinationURL)
show Method
func show(fromRootViewController viewController: UIViewController)
viewController
UIViewController
required
Root view controller to present the ad from

Properties

PropertyTypeDescription
delegateAdropPopupAdDelegate?Ad event delegate (read/write)
closeDelegateAdropPopupAdCloseDelegate?Close event delegate (read/write)
isLoadedBoolWhether ad is loaded (read-only)
unitIdStringUnit ID (read-only)
txIdStringCurrent transaction ID (read-only)
txIds[String]All transaction IDs (read-only)
campaignIdStringCurrent campaign ID (read-only)
campaignIds[String]All campaign IDs (read-only)
creativeIdString?Current creative ID (read-only)
creativeIds[String]All creative IDs (read-only)
destinationURLString?Ad destination URL (read-only)
useCustomClickBoolWhether to use custom click handling (read/write)
browserTargetBrowserTarget?How to open URLs on ad click (read-only)
backgroundColorUIColor?Popup background color (read/write)
hideForTodayTextColorUIColor?”Don’t show today” text color (read/write)
closeTextColorUIColor?Close button text color (read/write)
ctaTextColorUIColor?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”
Usage Example:
let popupAd = AdropPopupAd(unitId: "YOUR_UNIT_ID")
popupAd.delegate = self
popupAd.closeDelegate = self
popupAd.load()

// After ad loads
if popupAd.isLoaded {
    popupAd.show(fromRootViewController: self)
}

AdropSplashAd

Class for managing splash ads.
AdropSplashAd cannot be instantiated directly (the initializer is internal). Use AdropSplashAdViewController or AdropSplashAdView to display splash ads.

Properties

PropertyTypeDescription
delegateAdropSplashAdDelegate?Delegate (read/write)
unitIdStringUnit ID (read-only)
txIdStringTransaction ID (read-only)
campaignIdStringCampaign ID (read-only)
creativeIdStringCreative ID (read-only)
destinationURLStringAd destination URL (read-only)
readyToShowBoolWhether the ad is ready to display (read-only)
adImageUIImage?Cached ad image (read-only)

AdropSplashAdViewController

View controller for displaying splash ads in full screen.

Initialization

init(unitId: String, adRequestTimeout: TimeInterval = 1)
unitId
String
required
Splash ad unit ID created in the Ad Control Console
adRequestTimeout
TimeInterval
default:"1"
Ad request timeout in seconds

Methods

MethodReturn TypeDescription
close()voidClose the splash ad and transition to mainViewController

Properties

PropertyTypeDescription
delegateAdropSplashAdDelegate?Delegate (read/write)
splashAdAdropSplashAdUnderlying splash ad object (read-only)
displayDurationTimeIntervalAd display duration (default: 1 second, deprecated — set in console)
logoImageUIImage?Logo image to display at bottom (read/write)
backgroundColorUIColor?Background color (read/write)
mainViewControllerUIViewController?Main view controller to transition to after splash ad closes (read/write)
Usage Example:
let splashVC = AdropSplashAdViewController(unitId: "YOUR_UNIT_ID")
splashVC.delegate = self
splashVC.displayDuration = 3.0  // Display for 3 seconds
splashVC.logoImage = UIImage(named: "app_logo")  // Set logo image
splashVC.modalPresentationStyle = .fullScreen
present(splashVC, animated: false)

AdropSplashAdView

View for displaying splash ads. Inherits from UIImageView.

Initialization

init(unitId: String, adRequestTimeout: TimeInterval = 1)
unitId
String
required
Splash ad unit ID created in the Ad Control Console
adRequestTimeout
TimeInterval
default:"1"
Ad request timeout in seconds
Loading happens automatically on initialization. Do not call load() directly.

Properties

PropertyTypeDescription
delegateAdropSplashAdViewDelegate?Delegate (read/write)
adAdropSplashAdUnderlying splash ad object (read-only)
unitIdStringUnit ID (read-only)
txIdString?Transaction ID (read-only)
creativeIdStringCreative ID (read-only)
isClosedBoolWhether the splash ad has closed (read-only)
displayDurationTimeIntervalAd display duration (deprecated — set in console)

AdropMetrics

Class for managing user properties and events.

Static Properties

PropertyTypeDescription
userDataConsentBoolUser data consent status (default: true, read-only)

Static Methods

MethodReturn TypeDescription
setUserDataConsent(_:)voidSet 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:)voidSet user property
sendEvent(name:params:)voidSend user event
logEvent(name:params:)voidDeprecated. Use sendEvent instead.

Set User Property

static func setProperty(key: String, value: Encodable?)
key
String
required
Property key (max 64 characters)
value
Any
required
Property value (supports String, Int, Double, Bool)
Usage Example:
AdropMetrics.setProperty(key: "age", value: 25)
AdropMetrics.setProperty(key: "gender", value: "male")
AdropMetrics.setProperty(key: "isPremium", value: true)

Send Event

static func sendEvent(name: String, params: [String: Any]? = nil)
name
String
required
Event name (1–64 characters)
params
[String: Any]?
Event parameters dictionary. Keys max 64 characters, string values max 1024 characters.
Usage Example:
// Simple event
AdropMetrics.sendEvent(name: "app_open")

// Event with parameters
AdropMetrics.sendEvent(name: "view_item", params: [
    "item_id": "SKU-123",
    "item_name": "Widget",
    "price": 29.99
])

// Multi-item event (purchase)
AdropMetrics.sendEvent(name: "purchase", params: [
    "tx_id": "tx_123",
    "currency": "KRW",
    "items": [
        ["item_id": "A", "item_name": "Product A", "price": 100, "quantity": 1],
        ["item_id": "B", "item_name": "Product B", "price": 200, "quantity": 2]
    ]
])
logEvent() is deprecated and will be removed in a future version. Use sendEvent() instead.
  • 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)

@available(*, deprecated, renamed: "sendEvent(name:params:)")
static func logEvent(name: String, params: [String: Encodable]? = [:])
This method is deprecated. Use sendEvent(name:params:) instead.

Protocols (Delegates)

AdropBannerDelegate

Protocol for handling banner ad lifecycle events.

Required Methods

func onAdReceived(_ banner: AdropBanner)
Called when ad is received successfully.
func onAdFailedToReceive(_ banner: AdropBanner, _ errorCode: AdropErrorCode)
Called when ad fails to receive.

Optional Methods

optional func onAdImpression(_ banner: AdropBanner)
Called when ad is displayed on screen.
optional func onAdClicked(_ banner: AdropBanner)
Called when user clicks the ad. Implementation Example:
extension ViewController: AdropBannerDelegate {
    func onAdReceived(_ banner: AdropBanner) {
        print("Banner ad received")
    }

    func onAdFailedToReceive(_ banner: AdropBanner, _ errorCode: AdropErrorCode) {
        print("Banner ad failed: \(errorCode)")
    }

    func onAdImpression(_ banner: AdropBanner) {
        print("Banner ad impression")
    }

    func onAdClicked(_ banner: AdropBanner) {
        print("Banner ad clicked")
    }
}

AdropNativeAdDelegate

Protocol for handling native ad lifecycle events.

Required Methods

func onAdReceived(_ ad: AdropNativeAd)
Called when ad is received successfully.
func onAdFailedToReceive(_ ad: AdropNativeAd, _ errorCode: AdropErrorCode)
Called when ad fails to receive.

Optional Methods

optional func onAdImpression(_ ad: AdropNativeAd)
Called when ad is displayed on screen.
optional func onAdClicked(_ ad: AdropNativeAd)
Called when user clicks the ad.

AdropInterstitialAdDelegate

Protocol for handling interstitial ad lifecycle events.

Required Methods

func onAdReceived(_ ad: AdropInterstitialAd)
Called when ad is received successfully.
func onAdFailedToReceive(_ ad: AdropInterstitialAd, _ errorCode: AdropErrorCode)
Called when ad fails to receive.

Optional Methods

optional func onAdImpression(_ ad: AdropInterstitialAd)
Called when ad is displayed on screen.
optional func onAdClicked(_ ad: AdropInterstitialAd)
Called when user clicks the ad.
optional func onAdWillPresentFullScreen(_ ad: AdropInterstitialAd)
Called just before the ad is displayed in full screen.
optional func onAdDidPresentFullScreen(_ ad: AdropInterstitialAd)
Called immediately after the ad is displayed in full screen.
optional func onAdWillDismissFullScreen(_ ad: AdropInterstitialAd)
Called just before the ad is dismissed.
optional func onAdDidDismissFullScreen(_ ad: AdropInterstitialAd)
Called when ad is closed.
optional func onAdFailedToShowFullScreen(_ ad: AdropInterstitialAd, _ errorCode: AdropErrorCode)
Called when ad fails to show.

AdropRewardedAdDelegate

Protocol for handling rewarded ad lifecycle events.

Required Methods

func onAdReceived(_ ad: AdropRewardedAd)
Called when ad is received successfully.
func onAdFailedToReceive(_ ad: AdropRewardedAd, _ errorCode: AdropErrorCode)
Called when ad fails to receive.

Optional Methods

optional func onAdImpression(_ ad: AdropRewardedAd)
Called when ad is displayed on screen.
optional func onAdClicked(_ ad: AdropRewardedAd)
Called when user clicks the ad.
optional func onAdWillPresentFullScreen(_ ad: AdropRewardedAd)
Called just before the ad is displayed in full screen.
optional func onAdDidPresentFullScreen(_ ad: AdropRewardedAd)
Called immediately after the ad is displayed in full screen.
optional func onAdWillDismissFullScreen(_ ad: AdropRewardedAd)
Called just before the ad is dismissed.
optional func onAdDidDismissFullScreen(_ ad: AdropRewardedAd)
Called when ad is closed.
optional func onAdFailedToShowFullScreen(_ ad: AdropRewardedAd, _ errorCode: AdropErrorCode)
Called when ad fails to show.

AdropPopupAdDelegate

Protocol for handling popup ad lifecycle events.

Required Methods

func onAdReceived(_ ad: AdropPopupAd)
Called when ad is received successfully.
func onAdFailedToReceive(_ ad: AdropPopupAd, _ errorCode: AdropErrorCode)
Called when ad fails to receive.

Optional Methods

optional func onAdImpression(_ ad: AdropPopupAd)
Called when ad is displayed on screen.
optional func onAdClicked(_ ad: AdropPopupAd)
Called when user clicks the ad.
optional func onAdWillPresentFullScreen(_ ad: AdropPopupAd)
Called just before the popup ad is displayed.
optional func onAdDidPresentFullScreen(_ ad: AdropPopupAd)
Called immediately after the popup ad is displayed.
optional func onAdWillDismissFullScreen(_ ad: AdropPopupAd)
Called just before the popup ad is dismissed.
optional func onAdDidDismissFullScreen(_ ad: AdropPopupAd)
Called when ad is closed.
optional func onAdFailedToShowFullScreen(_ ad: AdropPopupAd, _ errorCode: AdropErrorCode)
Called when ad fails to show.

AdropPopupAdCloseDelegate

Protocol for handling popup ad close events.

Optional Methods

optional func onClosed(_ ad: AdropPopupAd)
Called when user clicks the close button.
optional func onDimClicked(_ ad: AdropPopupAd)
Called when user clicks outside the popup (dim area).
optional func onTodayOffClicked(_ ad: AdropPopupAd)
Called when user selects “Don’t show today”.

AdropSplashAdDelegate

Protocol for handling splash ad lifecycle events. All methods are @objc optional.

Optional Methods

optional func onAdReceived(_ ad: AdropSplashAd)
Called when ad is received successfully.
optional func onAdFailedToReceive(_ ad: AdropSplashAd, _ errorCode: AdropErrorCode)
Called when ad fails to receive.
optional func onAdImpression(_ ad: AdropSplashAd)
Called when ad is displayed on screen.
optional func onAdClose(_ ad: AdropSplashAd, impressed: Bool)
Called when the splash ad is closed. impressed indicates whether the ad was fully displayed.

AdropSplashAdViewDelegate

Protocol for handling splash ad view lifecycle events.

Required Methods

func onAdClose(_ adView: AdropSplashAdView, impressed: Bool)
Called when the splash ad view is closed. impressed indicates whether the ad was fully displayed.

Optional Methods

optional func onAdReceived(_ adView: AdropSplashAdView)
Called when ad is received successfully.
optional func onAdFailedToReceive(_ adView: AdropSplashAdView, _ errorCode: AdropErrorCode)
Called when ad fails to receive.
optional func onAdImpression(_ adView: AdropSplashAdView)
Called when ad is displayed on screen.

UseCustomClick

Protocol for handling custom ad click behavior. Implemented by AdropBanner, AdropNativeAd, and AdropPopupAd.
Property / MethodTypeDescription
destinationURLString?The destination URL of the ad (read-only)
useCustomClickBoolWhen true, disables automatic URL opening on ad click
open(_:useInAppBrowser:)MethodOpens a URL manually. Call this in click callback when useCustomClick is true

Enums

AdropErrorCode

Error codes that can occur during ad loading and display.
enum AdropErrorCode: Int
CaseCode ValueDescription
ERROR_CODE_NETWORK0Network error
ERROR_CODE_INTERNAL1Internal error
ERROR_CODE_INITIALIZE2SDK initialization failed
ERROR_CODE_INVALID_UNIT3Invalid unit ID
ERROR_CODE_NOT_TARGET_COUNTRY4Not a target country
ERROR_CODE_AD_INACTIVE5No active campaigns
ERROR_CODE_AD_NO_FILL6No ads available to display
ERROR_CODE_AD_LOAD_DUPLICATED7Duplicate ad load request
ERROR_CODE_AD_LOADING8Ad is loading
ERROR_CODE_AD_EMPTY9Ad not loaded
ERROR_CODE_AD_SHOWN10Ad already shown
ERROR_CODE_AD_HIDE_FOR_TODAY11”Don’t show today” is set
ERROR_CODE_ACCOUNT_USAGE_LIMIT_EXCEEDED12Account usage limit exceeded
ERROR_CODE_LANDSCAPE_UNSUPPORTED13Landscape mode not supported
ERROR_CODE_AD_BACKFILL_NO_FILL14No backfill ads available

Error Code Descriptions

Network Related
  • ERROR_CODE_NETWORK: Network connection error occurred. Check internet connection.
Initialization Related
  • ERROR_CODE_INITIALIZE: SDK is not initialized. Call Adrop.initialize() first.
Unit Related
  • 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.
Ad Related
  • 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.
Ad State Related
  • 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”.
Other
  • 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.
Usage Example:
func onAdFailedToReceive(_ banner: AdropBanner, _ errorCode: AdropErrorCode) {
    switch errorCode {
    case .ERROR_CODE_NETWORK:
        print("Network error: Check your connection")
    case .ERROR_CODE_AD_NO_FILL:
        print("No ads available to display")
    case .ERROR_CODE_INVALID_UNIT:
        print("Invalid unit ID")
    default:
        print("Ad load failed: \(errorCode.rawValue)")
    }
}

AdropTheme

Enum representing app theme settings.
enum AdropTheme
CaseDescription
lightLight mode
darkDark mode
autoFollow system setting (default)
Usage Example:
// Set light mode
Adrop.setTheme(.light)

// Set dark mode
Adrop.setTheme(.dark)

// Follow system setting
Adrop.setTheme(.auto)

BrowserTarget

Controls how ad URLs are opened.
ValueDescription
EXTERNALOpens URL in the default external browser (default)
INTERNALOpens URL in an in-app browser

Structs and Types

AdropNativeAdProfile

Struct containing advertiser profile information.
struct AdropNativeAdProfile {
    let displayLogo: String     // Advertiser logo URL
    let displayName: String     // Advertiser name
    let link: String?           // Advertiser profile link
}
Usage Example:
let profile = nativeAd.profile
profileNameLabel.text = profile.displayName
loadImage(from: profile.displayLogo, into: profileImageView)

AdropServerSideVerificationOptions

Class for setting server-side verification options for rewarded ads.
class AdropServerSideVerificationOptions: NSObject {
    var userId: String?
    var customData: String?

    init(userId: String? = nil, customData: String? = nil)
}
PropertyTypeDescription
userIdString?User identifier for server-side verification
customDataString?Custom data string to include in the server callback
Usage Example:
let options = AdropServerSideVerificationOptions(
    userId: "user_12345",
    customData: "level_5_reward"
)
rewardedAd.serverSideVerificationOptions = options

Constants

AdropUnitId

Test unit ID constants.
struct AdropUnitId {
    // Banner ads
    static let PUBLIC_TEST_UNIT_ID_320_50: String
    static let PUBLIC_TEST_UNIT_ID_320_100: String
    static let PUBLIC_TEST_UNIT_ID_CAROUSEL: String
    static let PUBLIC_TEST_UNIT_ID_BANNER_VIDEO_16_9: String
    static let PUBLIC_TEST_UNIT_ID_BANNER_VIDEO_9_16: String

    // Native ads
    static let PUBLIC_TEST_UNIT_ID_NATIVE: String
    static let PUBLIC_TEST_UNIT_ID_NATIVE_VIDEO_16_9: String
    static let PUBLIC_TEST_UNIT_ID_NATIVE_VIDEO_9_16: String

    // Interstitial ads
    static let PUBLIC_TEST_UNIT_ID_INTERSTITIAL: String

    // Rewarded ads
    static let PUBLIC_TEST_UNIT_ID_REWARDED: String

    // Popup ads
    static let PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM: String
    static let PUBLIC_TEST_UNIT_ID_POPUP_CENTER: String
    static let PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM_VIDEO_16_9: String
    static let PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM_VIDEO_9_16: String
    static let PUBLIC_TEST_UNIT_ID_POPUP_CENTER_VIDEO_16_9: String
    static let PUBLIC_TEST_UNIT_ID_POPUP_CENTER_VIDEO_9_16: String

    // Splash ads
    static let PUBLIC_TEST_UNIT_ID_SPLASH: String
}
Usage Example:
let banner = AdropBanner(unitId: AdropUnitId.PUBLIC_TEST_UNIT_ID_320_100)
let carouselBanner = AdropBanner(unitId: AdropUnitId.PUBLIC_TEST_UNIT_ID_CAROUSEL)
let nativeAd = AdropNativeAd(unitId: AdropUnitId.PUBLIC_TEST_UNIT_ID_NATIVE)
let interstitial = AdropInterstitialAd(unitId: AdropUnitId.PUBLIC_TEST_UNIT_ID_INTERSTITIAL)
let popup = AdropPopupAd(unitId: AdropUnitId.PUBLIC_TEST_UNIT_ID_POPUP_CENTER)
Use test unit IDs only in development environments. You must use actual unit IDs created in the console for production.

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