Menu

Splash ads

You have already added and configured a Custom Adapter in the TopOn dashboard. If you have not done so, please click here.

The following example is a non-bidding ad implementation. For bidding implementation of Custom Adapter, please refer to here.

1. Create Adapter Class

Create the SplashAdapter class based on the class name you added in the TopOn dashboard (in this example, it is named CustomSplashAdapter).

Copy
// CustomSplashAdapter.h

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface CustomSplashAdapter : NSObject

@end

NS_ASSUME_NONNULL_END
Copy
// CustomSplashAdapter.m

#import "CustomSplashAdapter.h"

@interface CustomSplashAdapter ()
 
@end

@implementation CustomSplashAdapter

@end

2. Conform to and Implement the ATAdAdapter Protocol

Make the CustomSplashAdapter class created in the previous step conform to the ATAdAdapter protocol and implement the required methods.

For more information about the ATAdAdapter protocol, please click here.

Copy
#import "CustomSplashAdapter.h"
#import <AnyThinkSDK/AnyThinkSDK.h>
#import <AnyThinkSplash/ATSplash.h>

@interface CustomSplashAdapter() <ATAdAdapter>

@end

@implementation CustomSplashAdapter

/// Required. Used to initialize the custom adapter. For non-bidding ads. For bidding ads, please refer to the documentation.
/// - Parameters:
///   - serverInfo: The parameter dictionary configured on the server side
///   - localInfo: The parameter dictionary passed in for this load
- (instancetype)initWithNetworkCustomInfo:(NSDictionary*)serverInfo localInfo:(NSDictionary*)localInfo {
    self = [super init];
    if (self != nil) {
        // Add your ad SDK initialization method here
    }
    return self;
}


/// Required. The logic for the Custom Adapter to load ads.
/// - Parameters: The logic for the Custom Adapter loading ads.
///   - serverInfo: The parameter dictionary configured on the server side
///   - localInfo: The parameter dictionary passed in for this load
///   - completion: The completion callback
- (void)loadADWithInfo:(NSDictionary*)serverInfo localInfo:(NSDictionary*)localInfo completion:(void (^)(NSArray<NSDictionary *> *, NSError *))completion {
    
    // Load ad
}


/// Required. Used to determine whether the Custom Adapter's ad is ready (or within the ad validity period).
/// - Parameters:
///   - customObject: The custom ad object
///   - info: The parameter dictionary configured on the server side
+ (BOOL)adReadyWithCustomObject:(id)customObject info:(NSDictionary*)info {
    
    BOOL flag = YES;
    // Logic for determining whether the ad is ready
    
    return flag;
}

/// Implement the logic for the Custom Adapter to display Splash ads.
/// - Parameters:
///   - splash: The object passed in for this load
///   - localInfo: The parameter dictionary passed in for this load, including the window and other parameters passed in when showing the ad.
///   - delegate: The ad object delegate
+ (void)showSplash:(ATSplash *)splash localInfo:(NSDictionary *)localInfo delegate:(id)delegate {
    
    // Show the ad
    
}
  
@end

3. Create the Ad Callback CustomEvent Class

Implement a custom CustomEvent class (named SplashCustomEvent in this example), inheriting from the ATSplashCustomEvent class, and add the callback delegate corresponding to the Custom Adapter through this class. When the third-party ad platform has a callback, call the event method you defined in this class. In your defined event method, you need to call the method inherited from ATSplashCustomEvent to pass the event back to the TopOn iOS SDK. In this example, only the ad load completion callback is illustrated; other methods should be added by you.

Please click here to view the detailed description of the ATSplashCustomEvent class.

Copy
//SplashCustomEvent.h

#import <AnyThinkSplash/AnyThinkSplash.h>

NS_ASSUME_NONNULL_BEGIN

@interface SplashCustomEvent : ATSplashCustomEvent

@end

NS_ASSUME_NONNULL_END
Copy
@implementation SplashCustomEvent
  
/// This is the ad load completion callback of your ad platform SDK. Please refer to your ad platform SDK documentation for the specific method name and parameters.
- (void)your3rdSDKInterstitialAdDidLoad:(id)rewardedVideoAd {
    ...
    // Pass the information back to the TopOn iOS SDK
    [self trackSplashAdLoaded:rewardedVideoAd adExtra:nil];
}

...
Other methods that need to be called back

@end
Previous
Interstitials
Next
Banner ads
Last modified: 2026-07-09Powered by