Menu

ATAdManager

The base ad operation class, including ad loading, filtering ads, scenario statistics, bidding tools, and other features.

Copy
extern NSString *const kATAdAssetsNativeCustomEventKey;
extern NSString *const kATAdAssetsCustomEventKey;
extern NSString *const kATAdAssetsCustomObjectKey;
extern NSString *const kATExtraInfoRootViewControllerKey;
extern NSString *const kATAdAssetsDelegateObjKey;
extern NSString *const kATAdAssetsCustomNativeAdKey;
extern NSString *const kATAdAssetsCustomShowVcKey;

extern NSString *const kATAdLoadingExtraMediaExtraKey;
extern NSString *const kATAdLoadingExtraNetworkPlacementIDKey;
extern NSString *const kATAdLoadingExtraAdmobContentURLStringsKey;

/*
 * Banner ad size, the value is of type CGSize wrapped in NSValue.
 * Currently Banner ad loading only supports the (320.0f, 50.0f) size,
 * so values passed via this key will be ignored.
 * Developers should use kATAdLoadingExtraBannerAdSizeKey to set the Banner size; this key has no effect.
 */
extern NSString *const kATExtraInfoAdSizeKey;
extern NSString *const kATAdLoadingExtraGDTEnableDefaultAudioSessionKey;

typedef BOOL(^AdSourceCustomizeFillterBlock)(NSDictionary *extra);

@protocol ATAdLoadingDelegate;

@interface ATAdManager : NSObject

@property (nonatomic,strong) NSDictionary *extra;
@property (nonatomic,strong) NSMutableDictionary *exludeUnitIDDic;
@property (nonatomic,strong) NSMutableDictionary *exludeNetworkFirmIDDic;
@property (nonatomic,strong) NSMutableDictionary *showingUnitIdDic;

@property(nonatomic, copy) AdSourceCustomizeFillterBlock adSourceCustomizeFillter;

/// Singleton object
+ (instancetype)sharedManager;

/// Called when loading an ad
/// @param placementID - Taku Ad Placement ID
/// @param extra - Local configuration parameters
/// @param delegate - Delegate object
- (void)loadADWithPlacementID:(NSString *)placementID
                        extra:(NSDictionary *)extra
                     delegate:(id<ATAdLoadingDelegate>)delegate;

- (void)loadADWithPlacementID:(NSString *)placementID
                        extra:(NSDictionary *)extra
                      tkExtra:(nullable NSDictionary *)tkExtra
                adxFloorPrice:(nullable ATADXFloorPrice *)adxFloorPrice
                     delegate:(id<ATAdLoadingDelegate>)delegate;

// Filter target Ad Sources under the Ad Placement (by UnitID)
- (void)setExludePlacementid:(NSString *)placementid
                 unitIDArray:(NSArray <NSString *> *)unitIDArray;

/// Set the ad networks to be excluded when loading the Ad Placement, effective on the next load
/// @param placementid - Taku Ad Placement ID
/// @param networkFirmIDArray - Array of ad network IDs to exclude
- (void)setExludePlacementid:(NSString *)placementid
          networkFirmIDArray:(NSArray <NSNumber *> *)networkFirmIDArray;

/// Get ad extraInfo information by placementID and requestID
- (NSDictionary *)extraInfoForPlacementID:(NSString*)placementID
                                requestID:(NSString*)requestID;

/// Pass the Ad Placement ID to output, filter Ad Sources
- (void)setAdSourceCustomizeFillterPlacementIDArray:(NSArray <NSString *> *)placementIDArray;

/// Enter scenario tracking (for dashboard data statistics)
- (void)entryAdScenarioWithPlacementID:(NSString *)placementID scenarioID:(NSString *)scenarioID;

/// Check cached ads by Ad Placement ID, the first item is the ad to be displayed next
- (NSArray<NSDictionary *> *)getAdValidAdsForPlacementID:(NSString *)placementID;

/// Only notify us after custom close of the ad
/// @param placementID - Taku Ad Placement ID
- (void)customCloseADEventWithPlacementID:(NSString *)placementID;

// Bidding tool, bid win/loss interfaces // TODO ZSR To be optimized
+ (void)trackWinWithPlacementID:(nonnull NSString *)placementID extra:(nullable NSDictionary*)extra;
+ (void)trackLossWithPlacementID:(nonnull NSString *)placementID extra:(nullable NSDictionary*)extra;

@end
Previous
Class
Next
ATBannerCustomEvent
Last modified: 2026-07-08Powered by