Skip to main content

Classes

Adrop

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

Static Methods

Static Properties

Initialize Method

Bool
default:"false"
Production mode. Set to true when deploying
Bool
default:"false"
Whether to use in-app browser. If true, ad clicks open within the app
[String]?
default:"nil"
Array of target country codes (e.g., [“KR”, “US”]). nil for all countries
Usage Example:

Set User Identifier

String
required
Unique ID to identify the user (max 100 characters)
Usage Example:

Set Theme

AdropTheme
required
App theme (light, dark, auto)
Usage Example:

AdropBanner

Class for displaying banner ads. Inherits from UIView.

Initialization

String
required
Banner ad unit ID created in the Ad Control Console
String
Contextual targeting ID (default: empty string)

Methods

Static Methods

Static Properties

Properties

Usage Example:

AdropNativeAd

Class for managing native ad data.

Initialization

String
required
Native ad unit ID created in the Ad Control Console
String
Contextual targeting ID (default: empty string)

Methods

Static Methods

Static Properties

Properties

Usage Example:

AdropInterstitialAd

Class for displaying interstitial ads.

Initialization

String
required
Interstitial ad unit ID created in the Ad Control Console

Methods

show Method
UIViewController
required
Root view controller to present the ad from

Properties

Usage Example:

AdropRewardedAd

Class for displaying rewarded ads.

Initialization

String
required
Rewarded ad unit ID created in the Ad Control Console

Methods

show Method
UIViewController
required
Root view controller to present the ad from
(_ 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

Usage Example:

AdropPopupAd

Class for displaying popup ads.

Initialization

String
required
Popup ad unit ID created in the Ad Control Console

Methods

show Method
UIViewController
required
Root view controller to present the ad from

Properties

Usage Example:

AdropSplashAd

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

Properties


AdropSplashAdViewController

View controller for displaying splash ads in full screen.

Initialization

String
required
Splash ad unit ID created in the Ad Control Console
TimeInterval
default:"1"
Ad request timeout in seconds

Methods

Properties

Usage Example:

AdropSplashAdView

View for displaying splash ads. Inherits from UIImageView.

Initialization

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

Properties


AdropMetrics

Class for managing user properties and events.

Static Properties

Static Methods

Set User Property

String
required
Property key (max 64 characters)
Any
required
Property value (supports String, Int, Double, Bool)
Usage Example:

Get Properties

Returns all user properties currently stored via setProperty(key:value:). Usage Example:

Send Event

String
required
Event name (1–64 characters)
[String: Any]?
Event parameters dictionary. Keys max 64 characters, string values max 1024 characters.
Usage Example:
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)

This method is deprecated. Use sendEvent(name:params:) instead.

Protocols (Delegates)

AdropBannerDelegate

Protocol for handling banner ad lifecycle events.

Required Methods

Called when ad is received successfully.
Called when ad fails to receive.

Optional Methods

Called when ad is displayed on screen.
Called when user clicks the ad.
Called when a batch of banner ads is received from AdropBanner.loads(...).
Called when a batch load from AdropBanner.loads(...) fails.
Called when the video ad starts playing.
Called when the video ad finishes playing. Implementation Example:

AdropNativeAdDelegate

Protocol for handling native ad lifecycle events.

Required Methods

Called when ad is received successfully.
Called when ad fails to receive.

Optional Methods

Called when ad is displayed on screen.
Called when user clicks the ad.
Called when a batch of native ads is received from AdropNativeAd.loads(...).
Called when a batch load from AdropNativeAd.loads(...) fails.
Called when the video ad starts playing.
Called when the video ad finishes playing.

AdropInterstitialAdDelegate

Protocol for handling interstitial ad lifecycle events.

Required Methods

Called when ad is received successfully.
Called when ad fails to receive.

Optional Methods

Called when ad is displayed on screen.
Called when user clicks the ad.
Called just before the ad is displayed in full screen.
Called immediately after the ad is displayed in full screen.
Called just before the ad is dismissed.
Called when ad is closed.
Called when ad fails to show.

AdropRewardedAdDelegate

Protocol for handling rewarded ad lifecycle events.

Required Methods

Called when ad is received successfully.
Called when ad fails to receive.

Optional Methods

Called when ad is displayed on screen.
Called when user clicks the ad.
Called just before the ad is displayed in full screen.
Called immediately after the ad is displayed in full screen.
Called just before the ad is dismissed.
Called when ad is closed.
Called when ad fails to show.

AdropPopupAdDelegate

Protocol for handling popup ad lifecycle events.

Required Methods

Called when ad is received successfully.
Called when ad fails to receive.

Optional Methods

Called when ad is displayed on screen.
Called when user clicks the ad.
Called just before the popup ad is displayed.
Called immediately after the popup ad is displayed.
Called just before the popup ad is dismissed.
Called when ad is closed.
Called when ad fails to show.
Called when the video ad starts playing.
Called when the video ad finishes playing.

AdropPopupAdCloseDelegate

Protocol for handling popup ad close events.

Optional Methods

Called when user clicks the close button.
Called when user clicks outside the popup (dim area).
Called when user selects “Don’t show today”.

AdropSplashAdDelegate

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

Optional Methods

Called when ad is received successfully.
Called when ad fails to receive.
Called when ad is displayed on screen.
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

Called when the splash ad view is closed. impressed indicates whether the ad was fully displayed.

Optional Methods

Called when ad is received successfully.
Called when ad fails to receive.
Called when ad is displayed on screen.

UseCustomClick

Protocol for handling custom ad click behavior. Implemented by AdropBanner, AdropNativeAd, and AdropPopupAd.

Enums

AdropErrorCode

Error codes that can occur during ad loading and display.

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:

AdropTheme

Enum representing app theme settings.
Usage Example:

BrowserTarget

Controls how ad URLs are opened.

Structs and Types

AdropNativeAdProfile

Struct containing advertiser profile information.
Usage Example:

AdropServerSideVerificationOptions

Class for setting server-side verification options for rewarded ads.
Usage Example:

Constants

AdropUnitId

Test unit ID constants.
Usage Example:
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