Overview
Interstitial ads are ads that cover the entire app screen. They are suitable for natural transition points in the app, such as level transitions in games or content page transitions.Features
- Immersive ads covering the full screen
- Maintained until user explicitly closes
- Support for image and video ads
- High visual attention
Use test unit ID in development:
PUBLIC_TEST_UNIT_ID_INTERSTITIALImplementation Methods
Adrop React Native SDK provides two ways to implement interstitial ads:- Class Method - Direct use of AdropInterstitialAd class
- Hook Method - Using useAdropInterstitialAd Hook (Recommended)
AdropInterstitialAd Class
Constructor
Create an AdropInterstitialAd instance.Ad unit ID (issued from console)
Properties
Returns whether the ad is loaded.
Returns the ad unit ID.
Returns the creative ID of the currently loaded ad.
Returns the transaction ID of the currently loaded ad.
Returns the campaign ID of the currently loaded ad.
Returns the destination URL of the currently loaded ad.
Returns the browser target setting of the currently loaded ad (
BrowserTarget.EXTERNAL or BrowserTarget.INTERNAL).Sets the listener to receive ad events.
Methods
Requests and loads the ad.
Shows the loaded ad. Should be called when
isLoaded is true.Closes the currently displayed ad. Useful for handling back button press on Android.
Destroys the ad instance and releases resources. Must be called on component unmount.
AdropListener Interface
Callback interface for receiving ad events.Recommended Callbacks
Called when ad reception is successful. At this point, you can call
show() to display the ad.Called when ad reception fails. You can check the failure reason through the error code.
Optional Callbacks
Called when ad impression is recorded.
Called when user clicks the ad.
Called just before the full-screen ad is displayed. You can perform actions such as pausing the game.
Called immediately after the full-screen ad is displayed.
Called just before the full-screen ad is closed.
Called immediately after the full-screen ad is closed. Good time to preload the next ad.
Called when ad display fails. You can check the failure reason through the error code.
Called when the user presses the back button while the ad is displayed. Android only.
Class Method Implementation Example
Method using AdropInterstitialAd class directly.useAdropInterstitialAd Hook
You can implement interstitial ads more easily using React Hook.Hook Usage
Ad unit ID. Passing
null will release the ad.Return Values
Loads the ad. Only works when
isReady is true.Shows the loaded ad.
Resets ad state and creates a new instance.
Whether the ad instance is ready.
Whether the ad is successfully loaded.
Whether the ad is displayed on screen.
Whether the ad is closed.
Whether the ad is clicked.
Error code occurred during ad loading or display.
Whether the back button was pressed while the ad is displayed. Android only.
Browser target setting of the loaded ad (
BrowserTarget.EXTERNAL or BrowserTarget.INTERNAL).Hook Method Implementation Example
Method using useAdropInterstitialAd Hook (recommended).Test Unit ID
Be sure to use test unit IDs in development and test environments.Error Handling
Errors that may occur during ad loading and display should be handled appropriately.Error Codes
| Error Code | Description | Response |
|---|---|---|
AdropErrorCode.network | Network error | Check network connection and retry |
AdropErrorCode.internal | Internal error | Retry or contact support |
AdropErrorCode.initialize | SDK initialization failed | Check SDK initialization code |
AdropErrorCode.invalidUnit | Invalid unit ID | Check unit ID |
AdropErrorCode.adNoFill | Ad inventory shortage | Normal, retry later |
AdropErrorCode.adLoading | Already loading | Retry after loading completes |
AdropErrorCode.adEmpty | No loaded ad | Show after loading ad |
AdropErrorCode.adShown | Already shown ad | Need to load new ad |
Error Handling Example
Best Practices
1. Appropriate Display Timing
Show ads at natural transition points in your app.2. Preloading
Preload ads to minimize user wait time.3. Frequency Limiting
Limit how often ads are shown.4. Game Pause Handling
Use listeners to manage game state in class method.5. Memory Management
Always release resources on component unmount.Platform Considerations
iOS
- On iOS, ads automatically close when the app goes to background
onAdDidDismissFullScreencallback is called
Android
- Ads can be closed with the back button on Android
- Hardware acceleration may be required
Backfill Ads
To use backfill ads, you must have the backfill dependency added to your native platforms (Android/iOS).
Next Steps
Rewarded Ads
Improve user engagement with rewarded ads
Banner Ads
Implement banner ads
Native Ads
Provide natural ad experience with native ads
Popup Ads
Implement popup ads