Native ad configuration class, used to set parameters such as the ad's display size, playback behavior, and rendering method.
// Video playback type enum
typedef NS_ENUM(NSUInteger, ATNativeADConfigVideoPlayType) {
ATNativeADConfigVideoPlayAlwaysAutoPlayType = 0, // Always auto-play
ATNativeADConfigVideoPlayOnlyWiFiAutoPlayType, // Auto-play only in WiFi environments
ATNativeADConfigVideoPlayClickAutoPlayType, // Auto-play after click
};
// Key for the Facebook-supported ad option view frame (CGRect wrapped as NSValue)
extern NSString *const kATNativeAdConfigurationContextAdOptionsViewFrameKey;
// Key for the ad logo view frame supported by GDT and Baidu (CGRect wrapped as NSValue), displayed in the top-left corner by default
extern NSString *const kATNativeAdConfigurationContextAdLogoViewFrameKey;
// Key for the network logo view frame supported by Baidu (CGRect wrapped as NSValue), displayed in the bottom-right corner by default
extern NSString *const kATNativeAdConfigurationContextNetworkLogoViewFrameKey;
@protocol ATNativeADDelegate;
@class ATNativePrepareInfo;
@interface ATNativeADConfiguration : NSObject
/**
* Some network-specific extra contextual information can be stored in this dictionary
*/
@property(nonatomic) NSDictionary *context;
@property(nonatomic) Class renderingViewClass; // Rendering view class
@property(nonatomic) CGRect ADFrame; // Ad size
@property(nonatomic) CGRect mediaViewFrame; // Media view size
@property(nonatomic, weak) UIViewController *rootViewController; // Root view controller
@property(nonatomic, weak) id<ATNativeADDelegate> delegate; // Delegate
@property(nonatomic) BOOL sizeToFit; // Whether to auto-resize
@property(nonatomic) BOOL useCustomPlayer; // Whether to use a custom player
// Video auto-play control, only supported for TopOn Adx self-rendering
@property (nonatomic, assign) ATNativeADConfigVideoPlayType videoPlayType;
@property(nonatomic, strong) ATNativePrepareInfo *nativePrepareInfo; // Native ad preparation info
@property (nonatomic, assign) CGRect logoViewFrame; // Logo view size
@end