Overview
Popup Ads are an ad format that appears on screen at specific moments. They can be displayed at desired timings such as app launch, content load completion, or specific event triggers. Users can close them by tapping the close button or selecting “Don’t show today.”Features
- Popup form 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 and text colors
- Non-intrusive yet effective ad experience
Use test unit IDs in development. See the Test Unit IDs section.
Implementation Steps
Implement popup ads in 4 steps:- Initialize - Create AdropPopupAd instance
- Set Listeners - Set listeners to receive ad and close events
- Load Ad - Request and receive ad
- Show Ad - Display ad on screen
Basic Implementation
Basic Usage
Implementing Listeners
Customization
You can customize the appearance of popup ads.Setting Background and Text Colors
Customization Options
| Property | Type | Description | Default |
|---|---|---|---|
backgroundColor | Int? | Popup background (dim) color | Black (0.8 opacity) |
hideForTodayTextColor | Int? | ”Don’t show today” text color | White |
closeTextColor | Int? | Close button text color | White |
ctaTextColor | Int? | CTA button text color | System default |
Custom Click Handling
To handle ad clicks with custom processing instead of opening the default browser, use theuseCustomClick property.
Ad Properties
The following properties are available on the popup ad object:Ad unit ID
Whether ad is loaded
Currently displayed ad creative ID
URL to navigate to when ad is clicked
Transaction ID (for ad impression tracking)
Campaign ID
Listener Methods
AdropPopupAdListener (Ad Events)
Required Methods
Called when ad is received successfully. You can call
show() at this point to display the ad.Called when ad fails to load. The error code indicates the cause of failure.
Optional Methods
Called when ad impression is recorded.
Called when user clicks the ad.
Called just before popup ad is displayed.
Called just after popup ad is displayed on screen.
Called just before popup ad is closed.
Called just after popup ad is closed. This is a good time to preload the next ad.
Called when ad fails to show. The error code indicates the cause of failure.
Called when video playback starts in a video popup ad.
Called when video playback ends in a video popup ad.
AdropPopupAdCloseListener (Close Events)
All methods are optional.Called when user clicks the close button.
Called when user clicks outside the popup (dim area).
Called when user selects “Don’t show today.” You can save the date in this callback to not show ads for the day.
Implementing “Don’t Show Today”
Here’s how to properly handle when a user selects “Don’t show today.”Implementation Using SharedPreferences
Usage Example
Popup Types
Popup ads are available in two types:| Type | Description | Position |
|---|---|---|
POPUP_BOTTOM | Bottom popup | Slides up from bottom of screen |
POPUP_CENTER | Center popup | Displayed at center of screen |
Popup type is configured when creating the ad unit in the Adrop console. No separate specification is needed in code.
Best Practices
1. Appropriate Display Timing
Popup ads are effective when displayed at these moments:2. Respect “Don’t Show Today”
If a user selects “Don’t show today,” always honor it.3. Frequency Limiting
Don’t show popup ads too frequently.4. Preload Ads
Preload ads for better user experience.5. Landscape Mode Handling
Popup ads are only supported in portrait mode. In landscape mode,onAdFailedToShowFullScreen is called.
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
Complete Example
Troubleshooting
Ad Not Displaying
onAdReceived is not called
onAdReceived is not called
- Verify SDK is initialized
- Check if unit ID is correct
- Check network connection status
- Verify
productionsetting during Adrop SDK initialization
onAdFailedToReceive is called
onAdFailedToReceive is called
- Check error code to identify cause
- Use test unit ID in test environment
- Retry later if ad inventory is insufficient
ERROR_CODE_AD_HIDE_FOR_TODAY: “Don’t show today” is active
Nothing happens after calling show()
Nothing happens after calling show()
- Verify
show()is called afteronAdReceivedcallback - Check if Activity is in valid state
- Check
isLoadedproperty to verify ad is loaded - Verify in portrait mode (landscape is not supported)
Ad doesn't show in landscape mode
Ad doesn't show in landscape mode
Popup ads are only supported in portrait mode. When
show() is called in landscape mode, onAdFailedToShowFullScreen is called with ERROR_CODE_LANDSCAPE_UNSUPPORTED error code.”Don’t Show Today” Not Working
Related Documentation
Getting Started
SDK installation and initialization
Interstitial Ads
Implement interstitial ads
Rewarded Ads
Implement rewarded ads
Banner Ads
Implement banner ads