Skip to main content

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:
  1. Initialize - Create AdropPopupAd instance
  2. Set Listener - Set listener for receiving ad events
  3. Load Ad - Request and receive ad
  4. Show Ad - Display ad on screen

Basic Implementation

AdropPopupAd Class

AdropPopupAd is the main class for managing popup ads.

Constructor Parameters

string
required
Popup ad unit ID. Use the unit ID created in the Ad Control console.
AdropPopupAdColors
Options for customizing popup ad colors.
  • closeTextColor: Close button text color
  • hideForTodayTextColor: “Don’t show today” text color
  • backgroundColor: Popup background (dim) color
boolean
default:"false"
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.
(ad: AdropPopupAd) => void
Called on successful ad reception. You can call show() at this point.
(ad: AdropPopupAd, errorCode?: any) => void
Called on ad reception failure. Check error code for failure reason.

Optional Callbacks

(ad: AdropPopupAd) => void
Called when ad impression is recorded.
(ad: AdropPopupAd) => void
Called when user clicks the ad. You can call ad.close() in this callback to dismiss the popup.
(ad: AdropPopupAd) => void
Called just before popup ad is displayed.
(ad: AdropPopupAd) => void
Called immediately after popup ad is displayed.
(ad: AdropPopupAd) => void
Called just before popup ad is dismissed.
(ad: AdropPopupAd) => void
Called immediately after popup ad is dismissed. Good time to preload next ad.
(ad: AdropPopupAd, errorCode?: any) => void
Called on ad display failure. Check error code for failure reason.
(ad: AdropPopupAd) => void
Called when the user presses the back button while the ad is displayed. Android only.
(ad: AdropPopupAd) => void
Called when a video ad starts playing.
(ad: AdropPopupAd) => void
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 after onAdReceived callback is fired.
Only call show() when the ad is loaded (isLoaded === true).

close()

Closes the currently displayed popup ad. Primarily used in the onAdClicked 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:
string
Ad unit ID
boolean
Whether the ad is loaded
string
Creative ID of the currently displayed ad
string
URL to navigate to on ad click
string
Transaction ID (for ad impression tracking)
string
Campaign ID
BrowserTarget
Browser target for ad click. BrowserTarget.EXTERNAL (0) opens the system browser, BrowserTarget.INTERNAL (1) opens an in-app browser.

Customization

Color Settings

Use AdropPopupAdColors type to customize popup ad colors.

AdropPopupAdColors Type

string
Close button text color. Supports HEX color codes or RGBA format.
string
“Don’t show today” text color. Supports HEX color codes or RGBA format.
string
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 the useCustomClick parameter.

Test Unit IDs

Use the following test unit IDs during development and testing.

Test Ad Usage Example

Make sure to use the actual unit ID created in the Ad Control console for production releases.

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

  • Verify SDK is initialized
  • Check if unit ID is correct
  • Check network connection
  • Use test unit ID in test environment
  • Check error code to identify cause
  • Retry later if ad inventory is insufficient
  • Verify native SDK is properly integrated
  • Verify show() is called after onAdReceived callback
  • Check isLoaded property to confirm ad is loaded
  • Verify native module is properly connected

Memory Leak


Getting Started

SDK installation and initialization

Interstitial Ads

Implementing interstitial ads

Rewarded Ads

Implementing rewarded ads

Banner Ads

Implementing banner ads