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_INTERSTITIALImplementation Steps
Implement interstitial ads in 4 steps:- Initialize - Create AdropInterstitialAd instance
- Set Delegate - Set delegate to receive ad events
- Load Ad - Request and receive ad
- 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 callingshow().
Delegate Implementation
SwiftUI Implementation
In SwiftUI, you can useUIViewControllerRepresentable or get the rootViewController from UIWindow to display.
Method 1: ViewModel Pattern
Delegate Methods
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. You can check the cause of failure through the error code.
Optional Methods
Called when ad impression is recorded.
Called when user clicks the ad.
Called just before the interstitial ad is displayed. You can pause animations, etc.
Called immediately after the interstitial ad is displayed on screen.
Called just before the interstitial ad is dismissed.
Called immediately after the interstitial ad is dismissed. Good time to preload the next ad.
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