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
}

See also AATNativeAdRating which represents the native ad rating.

Last updated