Skip to main content

Overview

Interstitial ads are ads displayed in full-screen format covering the entire app screen. They are suitable for display at natural transition points in the app, such as game level transitions or content page changes.

Features

  • Immersive ads covering the entire screen
  • Maintained until user explicitly closes
  • Supports both image and video ads
  • High visual attention
Use test unit ID in development environment: PUBLIC_TEST_UNIT_ID_INTERSTITIAL

Implementation Steps

Implement interstitial ads in 4 steps:
  1. Initialize - Create AdropInterstitialAd instance
  2. Set Delegate - Set delegate to receive ad events
  3. Load Ad - Request and receive ad
  4. Show Ad - Display ad on screen

UIKit Implementation

Basic Implementation

isLoaded Property

Property to check if the ad is loaded. It’s recommended to check this value before calling show().

Delegate Implementation


SwiftUI Implementation

In SwiftUI, you can use UIViewControllerRepresentable or get the rootViewController from UIWindow to display.

Method 1: ViewModel Pattern


Delegate Methods

Required Methods

(AdropInterstitialAd) -> Void
Called when ad is received successfully. You can call show() at this point to display the ad.
(AdropInterstitialAd, AdropErrorCode) -> Void
Called when ad fails to load. You can check the cause of failure through the error code.

Optional Methods

(AdropInterstitialAd) -> Void
Called when ad impression is recorded.
(AdropInterstitialAd) -> Void
Called when user clicks the ad.
(AdropInterstitialAd) -> Void
Called just before the interstitial ad is displayed. You can pause animations, etc.
(AdropInterstitialAd) -> Void
Called immediately after the interstitial ad is displayed on screen.
(AdropInterstitialAd) -> Void
Called just before the interstitial ad is dismissed.
(AdropInterstitialAd) -> Void
Called immediately after the interstitial ad is dismissed. Good time to preload the next ad.
(AdropInterstitialAd, AdropErrorCode) -> Void
Called when ad fails to show. You can check the cause of failure through the error code.

Closure Callbacks

As an alternative to delegates, you can use closure-based callbacks.
If both a delegate and closures are set, both will be called.

Best Practices

1. Preload Ads

Preload ads before displaying them to improve user experience.

2. Appropriate Display Timing

Display ads at natural transition points in your app.

3. Reload After Dismissal

Preload the next ad after the ad is dismissed.

4. Error Handling

Implement error handling for ad load failures.

5. Frequency Capping

Limit how often ads are displayed to avoid being too intrusive.

Next Steps

Rewarded Ads

Improve user engagement with rewarded ads

Banner Ads

Implementing banner ads

Targeting Settings

User attributes and contextual targeting

Reference

API reference documentation