Menu

Rewarded Video 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).

1.3 Server-Side Callback

  • Rewarded Video supports a server-side callback reward distribution mechanism, and also supports each ad platform's server-side callback feature. Please refer to Server-Side Reward.

1.4 Custom Callback Parameters

Regarding custom callback parameters for auto-load Rewarded Video ads, you need to pay attention to the following callback method:

Copy
- (void)rewardedVideoDidStartPlayingForPlacementID:(NSString *)placementID extra:(NSDictionary *)extra {
    NSLog(@"ATRewardedVideoViewController::rewardedVideoDidStartPlayingForPlacementID:%@ extra:%@", placementID, extra);

    /* Set extra, custom parameters that will be passed back in the delegate's Extra. Can be used for custom rule matching for this ad placement.
     When the server-side Rewarded Video callback is enabled, this value is set and then passed back to the developer when the reward is distributed.
     Special Note: If using a third-party Rewarded Video server-side callback service, due to the SDK's internal ad caching feature, the passed extended parameters may not be able to be changed in real time. Therefore, if you have such a 
     requirement, please use our Rewarded Video server-side callback service and set the corresponding extended parameters in the display API (requires using the regular Rewarded Video loading method).
     */
    [[ATRewardedVideoAutoAdManager sharedInstance] setLocalExtra:
      @{kATAdLoadingExtraUserIDKey:@"test_user_id"} placementID:@"your rv placementID"]; 

}

2. Enable Auto Load

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

/// Set auto-load Rewarded Video ad
/// - Parameter placementID: Ad Placement ID
- (void)loadRewardedVideoADWithPlacementID:(NSString *)placementID {
    [ATRewardedVideoAutoAdManager sharedInstance].delegate = self;
    // Set extra, custom parameters that will be passed back in the delegate's Extra. Can be used for custom rule matching for this ad placement.
    // When the server-side Rewarded Video callback is enabled, this value will be passed back to the developer when the reward is distributed.
    [[ATRewardedVideoAutoAdManager sharedInstance] setLocalExtra:
    @{kATAdLoadingExtraUserIDKey:@"test_user_id"} placementID:placementID];
    [[ATRewardedVideoAutoAdManager sharedInstance] addAutoLoadAdPlacementIDArray:@[placementID]];
}
  • Please avoid displaying ads in the (didFinishLoadingADWithPlacementID:) callback, as this will create a load-display loop.
  • Before displaying, you need to first check that the current app is in the foreground.
Copy
/// Display Ad
/// - Parameters:
///   - placementID: Ad Placement ID
- (void)showRewardedVideoADWithPlacementID:(NSString *)placementID {
    // Before displaying, check whether the ad is ready
    BOOL isReady = [[ATRewardedVideoAutoAdManager sharedInstance] autoLoadRewardedVideoReadyForPlacementID:placementID];
    if (isReady) {
       [[ATRewardedVideoAutoAdManager sharedInstance] showAutoLoadRewardedVideoWithPlacementID: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.
ATRewardedVideoAutoAdManager The auto-load Rewarded Video 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.
ATRewardedVideoDelegate Delegate callbacks for the Rewarded Video 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
Interstitial Ad Auto Load
Next
Third-party revenue feedback(SDK v6.4.12 or above)
Last modified: 2026-07-08Powered by