Overview
Popup ads are ad formats that appear on screen at specific moments. They can be displayed at desired timings such as app launch, content load completion, or specific event occurrences. Users can close them by tapping the close button or selecting “Don’t show for today.”Features
- Popup format displayed at center or bottom of screen
- Supports both image and video ads
- Provides close, dim (background) click, and “Don’t show for today” options
- Customizable background color, text color, etc.
- Non-intrusive yet effective ad experience
Use test unit IDs in development environment. See the Test Unit IDs section.
Implementation Steps
Implement popup ads in 4 steps:- Initialize - Create AdropPopupAd instance
- Set Delegates - Set delegates to receive ad and close events
- Load Ad - Request and receive ad
- Show Ad - Display ad on screen
UIKit Implementation
Basic Implementation
Delegate Implementation
SwiftUI Implementation
In SwiftUI, useUIViewControllerRepresentable or get the rootViewController from UIWindow to display.
ViewModel Pattern
Customization
You can customize the appearance of popup ads.Set Background Color and Text Color
Customization Options
Delegate Methods
AdropPopupAdDelegate (Ad Events)
Required Methods
(AdropPopupAd) -> Void
Called when ad is received successfully. You can call
show() at this point to display the ad.(AdropPopupAd, AdropErrorCode) -> Void
Called when ad fails to load. You can check the cause of failure through the error code.
Optional Methods
(AdropPopupAd) -> Void
Called when ad impression is recorded.
(AdropPopupAd) -> Void
Called when user clicks the ad.
(AdropPopupAd) -> Void
Called just before popup ad is displayed.
(AdropPopupAd) -> Void
Called immediately after popup ad is displayed on screen.
(AdropPopupAd) -> Void
Called just before popup ad is dismissed.
(AdropPopupAd) -> Void
Called immediately after popup ad is dismissed. Good time to preload the next ad.
(AdropPopupAd, AdropErrorCode) -> Void
Called when ad fails to show. You can check the cause of failure through the error code.
(AdropPopupAd) -> Void
Called when a video ad starts playing.
(AdropPopupAd) -> Void
Called when a video ad finishes playing.
AdropPopupAdCloseDelegate (Close Events)
All methods are optional.(AdropPopupAd) -> Void
Called when user clicks the close button.
(AdropPopupAd) -> Void
Called when user clicks outside the popup (dim area).
(AdropPopupAd) -> Void
Called when user selects “Don’t show for today.” You can save the date in this callback to prevent showing ads for the rest of the day.
Custom Click Handling
You can take control of ad click behavior by usinguseCustomClick. When enabled, the SDK will not automatically open the destination URL on click, and you can handle it yourself.
useCustomClick
useCustomClick is true, the SDK will not open the destination URL automatically when the ad is clicked. The onAdClicked delegate callback will still fire, and you can use the open() method or handle navigation yourself.
open()
Opens the destination URL of the ad. Can optionally pass a custom URL.close()
Programmatically dismiss the popup ad.Properties
Closure-based Callbacks
In addition to delegates, you can also use closure-based callbacks. This can be convenient when you don’t want to implement a full delegate pattern.Delegate callbacks and closure-based callbacks can be used simultaneously. Both will be called.
Implementing “Don’t Show for Today”
How to properly handle when users select “Don’t show for today.”The SDK automatically manages the “Don’t Show for Today” state. The following example shows how to add custom behavior alongside the built-in handling.
Implementation
The SDK automatically skips loading when the user has selected “Don’t show for today.” Simply callload() — the SDK handles the rest.
Best Practices
1. Appropriate Display Timing
Popup ads are effective when shown at these timings:2. Respect “Don’t Show for Today”
If user selects “Don’t show for today,” make sure to honor it.3. Frequency Capping
Don’t show popup ads too frequently.Test Unit IDs
Use the following test unit IDs during development and testing.Related Documentation
Getting Started
SDK installation and initialization
Interstitial Ads
Implementing interstitial ads
Rewarded Ads
Implementing rewarded ads
Banner Ads
Implementing banner ads