Menu

Interstitial Ad Auto Load

1. Integration Suggestions

1.1 Ad Loading

  • The same ad placement ID only needs to call the Auto Load API once.
  • There is no need to call ATAdManager's loadADWithPlacementID: method for ad loading.

1.2 Ad Display

  • Please avoid displaying ads in the (didFinishLoadingADWithPlacementID:) callback, as this will create a load-display loop.
  • Before displaying, the app must be in the active state (UIApplicationState==UIApplicationStateActive).

2. Enable Auto Load

Copy
// Import header file
#import <AnyThinkInterstitial/AnyThinkInterstitial.h>

/// Set auto-load Interstitial ad
/// - Parameter placementID: Ad Placement ID
- (void)loadInterstitialADWithPlacementID:(NSString *)placementID {
    // Set delegate
    [ATInterstitialAutoAdManager sharedInstance].delegate = self;
    // Set LocalExtra custom parameters that will be passed back in the delegate's Extra. Can be used for custom rule matching for this ad placement. See parameters for reference.
    [[ATInterstitialAutoAdManager sharedInstance] setLocalExtra:@{} placementID:placementID];
    // Start auto-loading ads
    [[ATInterstitialAutoAdManager sharedInstance] addAutoLoadAdPlacementIDArray:@[placementID]];
}

If you need to display the ad in the load success callback (didFinishLoadingADWithPlacementID:), to avoid the ad not being displayed properly, please ensure that the current app is in the active state (UIApplicationState==UIApplicationStateActive).

Copy
/// Display Ad
/// - Parameters:
///   - placementID: Ad Placement ID
- (void)showInterstitialADWithPlacementID:(NSString *)placementID {
    // Before displaying, check whether the ad is ready
    BOOL isReady = [[ATInterstitialAutoAdManager sharedInstance] autoLoadInterstitialReadyForPlacementID:placementID];
    if (isReady) {
       [[ATInterstitialAutoAdManager sharedInstance] showAutoLoadInterstitialWithPlacementID:placementID inViewController:self delegate:self];
    }
}

4. API Description

Class Name / File Name Introduction
ATAdManager The base ad operation class, including ad loading, filtering ads, scenario statistics, and other features.
ATInterstitialAutoAdManager The auto-load Interstitial ad management class, providing features for enabling auto load, removing auto load, setting local parameters, checking readiness status, displaying ads, and scenario statistics.
ATAdLoadingDelegate The base delegate callback declaration for ads, including ad placement-level and Ad Source-level load success or failure callbacks, and bid completion and bid failure callbacks for bidding Ad Sources.
ATInterstitialDelegate Delegate callbacks for the Interstitial ad type, including impression, click, and close, etc.
ATSDKGlobalSetting General settings class, providing features such as clearing in-memory ad caches, custom traffic group settings, test mode, configuring third-party ad SDK information, etc. It also declares some common properties.
Previous
Auto Load
Next
Rewarded Video Ad Auto Load
Last modified: 2026-07-08Powered by