Overview
Interstitial ads are full-screen ads that cover the entire screen. They are effective when displayed at natural transition points (e.g., after completing a game level, page transitions, etc.).Key Features
- Full-screen ads that cover the entire display
- Supports image and video ads
- Provides fullscreen event callbacks
- Flexible timing control with separate loading and showing
Use the test unit ID in development:
PUBLIC_TEST_UNIT_ID_INTERSTITIALAdropInterstitialAd
Constructor
| Parameter | Type | Required | Description |
|---|---|---|---|
unitId | String | Y | Unit ID created in Ad Control console |
listener | AdropInterstitialListener | N | Ad event listener |
Properties
| Property | Type | Description |
|---|---|---|
isLoaded | bool | Whether the ad has finished loading |
unitId | String | Ad unit ID |
creativeId | String | Creative ID |
txId | String | Transaction ID |
campaignId | String | Campaign ID |
destinationURL | String | Destination URL |
browserTarget | BrowserTarget? | Browser target (external or internal) |
Methods
| Method | Return Type | Description |
|---|---|---|
load() | Future<void> | Loads the ad |
show() | Future<void> | Displays the ad on screen |
close() | Future<void> | Programmatically closes the interstitial ad (Android only, no-op on iOS) |
dispose() | Future<void> | Releases resources |
When
close() is called, the ad is dismissed and the onAdDidDismissFullScreen callback is triggered. If close() is not called in the onAdBackButtonPressed callback, the ad remains displayed and only the callback is received. Whether to close the ad is up to the developer.Basic Usage
AdropInterstitialListener
Listener to handle interstitial ad events.Callbacks
Callback Descriptions
| Callback | Description |
|---|---|
onAdReceived | Called when ad is loaded successfully |
onAdClicked | Called when ad is clicked |
onAdImpression | Called when ad impression occurs |
onAdWillPresentFullScreen | Called before ad is presented (iOS only) |
onAdDidPresentFullScreen | Called after ad is presented |
onAdWillDismissFullScreen | Called before ad is dismissed (iOS only) |
onAdDidDismissFullScreen | Called after ad is dismissed |
onAdFailedToReceive | Called when ad fails to load |
onAdFailedToShowFullScreen | Called when ad fails to show |
onAdBackButtonPressed | Called when the user presses the back button while the ad is displayed (Android only) |
Ad Lifecycle
Ad Recreation
Interstitial ads are single-use. Once shown, they cannot be displayed again, so you must recreate the instance to load a new ad.Error Handling
Best Practices
1. Show at Appropriate Times
Display interstitial ads at natural transition points.2. Preload Ads
Preloading ads allows you to show them without delay when needed.3. Frequency Capping
Limit ad frequency for better user experience.4. Resource Management
Always release unused ad instances.Complete Example
Backfill Ads
When backfill ads are enabled, backfill ads are automatically loaded when direct ads are unavailable. You can handle backfill-related errors using the error code.To use backfill ads, add the backfill dependency to native platforms. See Getting Started.
Next Steps
Rewarded Ads
Implement rewarded ads that provide rewards
Popup Ads
Implement popup-style ads
Reference
Reference types, methods, and error codes