Overview
Popup ads are an ad format that appears on screen at specific moments. They can be displayed at app launch, content load completion, specific events, etc. Users can dismiss by tapping the close button or selecting “Don’t show today”.Features
- Popup format displayed at center or bottom of screen
- Image and video ad support
- Close, dim (background) click, and “Don’t show today” options
- Customizable background color, text color, etc.
- Non-intrusive yet effective ad experience
Use test unit IDs in development. See the Test Unit IDs section.
Implementation Steps
Popup ads are implemented in 4 steps:- Initialize - Create AdropPopupAd instance
- Set Listener - Set listener for receiving ad events
- Load Ad - Request and receive ad
- Show Ad - Display ad on screen
Basic Implementation
AdropPopupAd Class
AdropPopupAd is the main class for managing popup ads.
Constructor Parameters
Popup ad unit ID. Use the unit ID created in the Ad Control console.
Options for customizing popup ad colors.
closeTextColor: Close button text colorhideForTodayTextColor: “Don’t show today” text colorbackgroundColor: Popup background (dim) color
Whether to use custom click handling. When set to
true, only the onAdClicked callback is called instead of opening the default browser on ad click.Basic Usage
AdropListener Interface
Listener interface for receiving popup ad events.Recommended Callbacks
Called on successful ad reception. You can call
show() at this point.Called on ad reception failure. Check error code for failure reason.
Optional Callbacks
Called when ad impression is recorded.
Called when user clicks the ad. You can call
ad.close() in this callback to dismiss the popup.Called just before popup ad is displayed.
Called immediately after popup ad is displayed.
Called just before popup ad is dismissed.
Called immediately after popup ad is dismissed. Good time to preload next ad.
Called on ad display failure. Check error code for failure reason.
Called when the user presses the back button while the ad is displayed. Android only.
Called when a video ad starts playing.
Called when a video ad finishes playing.
Listener Implementation Example
Methods
load()
Requests and loads an ad.show()
Displays the loaded ad. Can only be called afteronAdReceived callback is fired.
close()
Closes the currently displayed popup ad. Primarily used in theonAdClicked callback.
destroy()
Cleans up the ad instance and releases resources. Must be called on component unmount.Ad Properties
The following properties are available on the popup ad object:Ad unit ID
Whether the ad is loaded
Creative ID of the currently displayed ad
URL to navigate to on ad click
Transaction ID (for ad impression tracking)
Campaign ID
Browser target for ad click.
BrowserTarget.EXTERNAL (0) opens the system browser, BrowserTarget.INTERNAL (1) opens an in-app browser.Customization
Color Settings
UseAdropPopupAdColors type to customize popup ad colors.
AdropPopupAdColors Type
Close button text color. Supports HEX color codes or RGBA format.
“Don’t show today” text color. Supports HEX color codes or RGBA format.
Popup background (dim) color. Supports HEX color codes or RGBA format. Transparency can be adjusted.
Custom Click Handling
To use custom handling instead of opening the default browser on ad click, use theuseCustomClick parameter.
Test Unit IDs
Use the following test unit IDs during development and testing.| Ad Type | Test Unit ID |
|---|---|
| Popup (Bottom Image) | PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM |
| Popup (Center Image) | PUBLIC_TEST_UNIT_ID_POPUP_CENTER |
| Popup Video (Bottom 16:9) | PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM_VIDEO_16_9 |
| Popup Video (Bottom 9:16) | PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM_VIDEO_9_16 |
| Popup Video (Center 16:9) | PUBLIC_TEST_UNIT_ID_POPUP_CENTER_VIDEO_16_9 |
| Popup Video (Center 9:16) | PUBLIC_TEST_UNIT_ID_POPUP_CENTER_VIDEO_9_16 |
Test Ad Usage Example
Error Handling
Handle errors appropriately by checking error codes on ad load or display failure.Best Practices
1. Appropriate Display Timing
Popup ads are most effective at these times:2. Frequency Limiting
Don’t show popup ads too frequently.3. Preload Ads
Preload ads for better user experience.4. Memory Management
Always clean up ads on component unmount.5. Close Popup on Click
Close popup on ad click for better user experience.Troubleshooting
Ad Not Displaying
onAdReceived not called
onAdReceived not called
- Verify SDK is initialized
- Check if unit ID is correct
- Check network connection
- Use test unit ID in test environment
onAdFailedToReceive is called
onAdFailedToReceive is called
- Check error code to identify cause
- Retry later if ad inventory is insufficient
- Verify native SDK is properly integrated
Nothing happens after show() is called
Nothing happens after show() is called
- Verify
show()is called afteronAdReceivedcallback - Check
isLoadedproperty to confirm ad is loaded - Verify native module is properly connected
Memory Leak
Related Documentation
Getting Started
SDK installation and initialization
Interstitial Ads
Implementing interstitial ads
Rewarded Ads
Implementing rewarded ads
Banner Ads
Implementing banner ads