Menu

Rewarded video ads

1. Integration Suggestions

1.1 Ad Loading

  • The Auto Load API only needs to be called once for the same placement ID.
  • You do not need to call the loadADWithPlacementID: method of ATAdManager to load the ad.

1.2 Ad Display

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

1.3 Server-Side Callback

  • Rewarded Video supports the server-side callback reward granting mechanism and also supports the server-side callback features of each ad network. Please refer to Server-Side Reward.

1.4 Custom Passthrough Parameters

Regarding the passthrough 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, which will be returned in the delegate's Extra and can be used for custom rule matching for this placement.
     When the server-side Rewarded Video callback is enabled, set this value and it will be returned to the developer when the reward is granted.
     Special note: If using a third-party Rewarded Video server-side callback service, due to the SDK's internal ad caching functionality, the passed extension parameters may not be able to achieve real-time updates. Therefore, if you have such requirements, please use the Rewarded Video server-side callback service we provide and set the corresponding extension 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 

/// Set up Auto Load Rewarded Video ad
/// - Parameter placementID: Placement ID
- (void)loadRewardedVideoADWithPlacementID:(NSString *)placementID {
    [ATRewardedVideoAutoAdManager sharedInstance].delegate = self;
    // Set extra, custom parameters, which will be returned in the delegate's Extra and can be used for custom rule matching for this placement.
    // When the server-side Rewarded Video callback is enabled, set this value and it will be returned to the developer when the reward is granted.
    [[ATRewardedVideoAutoAdManager sharedInstance] setLocalExtra:
    @{kATAdLoadingExtraUserIDKey:@"test_user_id"} placementID:placementID];
    [[ATRewardedVideoAutoAdManager sharedInstance] addAutoLoadAdPlacementIDArray:@[placementID]];
}
  • Please avoid displaying ads in the (didFinishLoadingADWithPlacementID:) callback, as this will cause a load-display loop.
  • Before displaying, you need to first check that the current app is in the foreground.
Copy
/// Display ad
/// - Parameters:
///   - placementID: Placement ID
- (void)showRewardedVideoADWithPlacementID:(NSString *)placementID {
    // Check if the ad is ready before displaying
    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 operation class for ads, including features such as ad loading, filtering ads, and scenario statistics.
ATRewardedVideoAutoAdManager The management class for Auto Load Rewarded Video ads, providing features such as enabling Auto Load, removing Auto Load, setting local parameters, checking ready status, displaying ads, and scenario statistics.
ATAdLoadingDelegate The base delegate callback declaration for ads, including placement-level and ad source-level load success or failure callbacks, as well as bidding completion and bidding failure callbacks for bidding ad sources.
ATRewardedVideoDelegate Delegate callbacks specific to the Rewarded Video ad type, including display, click, dismiss, etc.
ATSDKGlobalSetting A general settings class, providing features such as clearing ad memory caches, custom traffic group settings, test mode, setting third-party ad SDK related information, etc. It also declares some general properties.
Previous
Fully automatic loading
Next
Interstitial video ads
Last modified: 2026-07-08Powered by