AATNativeAdData
@objc public protocol AATNativeAdData : NSObjectProtocol {
/// A String represents the title of the ad, or null if it is not available.
@objc var title: String? { get }
/// A String represents the description of the ad, or null if it is not available.
@objc var adDescription: String? { get }
/// A String represents the call-to-action of the ad, or null if it is not available.
@objc var callToAction: String? { get }
/// A String represents the URL of the image asset of the ad, or null if it is not available.
@objc var imageUrl: String? { get }
/// A String represents the URL of the icon asset of the ad, or null if it is not available.
@objc var iconUrl: String? { get }
/// A NativeAdRating instance containing both value and scale of rating, or null if it is not available.
@objc var rating: AATNativeAdRating? { get }
/// A view represents the branding logo or ad information related to the ad network providing the native ad.
/// Some networks like Facebook Audience Network or Flurry require this special view to be visible on native ads.
@objc var brandingLogo: UIView? { get }
/// A String represents the advertiser asset of the ad, or null if it is not available.
@objc var advertiser: String? { get }
/// An AATAdNetwork represents the ad network providing the given native ad
@objc var network: AATAdNetwork { get }
/// Binds this native ad instance with given ViewGroup. Needed for click handling and tracking.
/// - Parameter view: View used to render the native ad.
/// - Parameter mainImageView: View used to show the main image of the ad. Can be null.
/// - Parameter iconView: View used to show the icon of the native ad.
/// - Parameter ctaView: View used to show the Call To Action of the native ad.
@objc func attachToView(_ view: UIView, mainImageView: UIView?, iconView: UIView?, ctaView: UIView?)
/// Removes the binding between the native ad and superview.
/// Should be called when the native ad will no longer be presented and will be removed from the view hierarchy.
@objc func detachFromLayout()
/// A Bool tells if the native ad has expired and shall no longer be used.
@objc func isExpired() -> Bool
/// A Bool tells if the native ad is ready to be displayed.
@objc func isReady() -> Bool
}
@protocol AATNativeAdData <NSObject>
/// A String represents the title of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable title;
/// A String represents the description of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable adDescription;
/// A String represents the call-to-action of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable callToAction;
/// A String represents the URL of the image asset of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable imageUrl;
/// A String represents the URL of the icon asset of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable iconUrl;
/// A NativeAdRating instance containing both value and scale of rating, or null if it is not available.
@property (nonatomic, readonly, strong) AATNativeAdRating * _Nullable rating;
/// A view represents the branding logo or ad information related to the ad network providing the native ad.
/// Some networks like Facebook Audience Network or Flurry require this special view to be visible on native ads.
@property (nonatomic, readonly, strong) UIView * _Nullable brandingLogo;
/// A String represents the advertiser asset of the ad, or null if it is not available.
@property (nonatomic, readonly, copy) NSString * _Nullable advertiser;
/// An AATAdNetwork represents the ad network providing the given native ad
@property (nonatomic, readonly) enum AATAdNetwork network;
/// Binds this native ad instance with given ViewGroup. Needed for click handling and tracking.
/// \param view View used to render the native ad.
///
/// \param mainImageView View used to show the main image of the ad. Can be null.
///
/// \param iconView View used to show the icon of the native ad.
///
/// \param ctaView View used to show the Call To Action of the native ad.
///
- (void)attachToView:(UIView * _Nonnull)view mainImageView:(UIView * _Nullable)mainImageView iconView:(UIView * _Nullable)iconView ctaView:(UIView * _Nullable)ctaView;
/// Removes the binding between the native ad and superview.
/// Should be called when the native ad will no longer be presented and will be removed from the view hierarchy.
- (void)detachFromLayout;
/// A Bool tells if the native ad has expired and shall no longer be used.
- (BOOL)isExpired;
/// A Bool tells if the native ad is ready to be displayed.
- (BOOL)isReady;
@end
See also AATNativeAdRating which represents the native ad rating.
Last updated