iOS SDK Version

FBNativeAd

@interfaceFBNativeAd:FBNativeAdBase
The FBNativeAd represents ad metadata to allow you to construct custom ad views. See the AdUnitsSample in the sample apps section of the Audience Network framework.
  • the delegate

    Declaration

    Objective-C
    @property(nonatomic,weak,readwrite,nullable)id<FBNativeAdDelegate>delegate;
    Swift
    weakvardelegate:FBNativeAdDelegate?{getset}
  • Undocumented

    Declaration

    Objective-C
    -(instancetype)initWithPlacementID:(NSString*)placementID;
    Swift
    init(placementID:String)
  • This is a method to associate a FBNativeAd with the UIView you will use to display the native ads.

    Declaration

    Objective-C
    -(void)registerViewForInteraction:(nonnullUIView*)viewmediaView:(nonnullFBMediaView*)mediaViewiconView:(nullableFBMediaView*)iconViewviewController:(nullableUIViewController*)viewController;
    Swift
    funcregisterView(forInteractionview:UIView,mediaView:FBMediaView,iconView:FBMediaView?,viewController:UIViewController?)

    Parameters

  • This is a method to associate FBNativeAd with the UIView you will use to display the native ads and set clickable areas.

    Declaration

    Objective-C
    -(void)registerViewForInteraction:(nonnullUIView*)viewmediaView:(nonnullFBMediaView*)mediaViewiconView:(nullableFBMediaView*)iconViewviewController:(nullableUIViewController*)viewControllerclickableViews:(nullableNSArray<UIView*>*)clickableViews;
    Swift
    funcregisterView(forInteractionview:UIView,mediaView:FBMediaView,iconView:FBMediaView?,viewController:UIViewController?,clickableViews:[UIView]?)

    Parameters

  • This is a method to associate a FBNativeAd with the UIView you will use to display the native ads.

    Declaration

    Objective-C
    -(void)registerViewForInteraction:(nonnullUIView*)viewmediaView:(nonnullFBMediaView*)mediaViewiconImageView:(nullableUIImageView*)iconImageViewviewController:(nullableUIViewController*)viewController;
    Swift
    funcregisterView(forInteractionview:UIView,mediaView:FBMediaView,iconImageView:UIImageView?,viewController:UIViewController?)

    Parameters

  • This is a method to associate FBNativeAd with the UIView you will use to display the native ads and set clickable areas.

    Declaration

    Objective-C
    -(void)registerViewForInteraction:(nonnullUIView*)viewmediaView:(nonnullFBMediaView*)mediaViewiconImageView:(nullableUIImageView*)iconImageViewviewController:(nullableUIViewController*)viewControllerclickableViews:(nullableNSArray<UIView*>*)clickableViews;
    Swift
    funcregisterView(forInteractionview:UIView,mediaView:FBMediaView,iconImageView:UIImageView?,viewController:UIViewController?,clickableViews:[UIView]?)

    Parameters

  • This is a method to use to download all media for the ad (adChoicesIcon, icon, image, video). This is only needed to be called if the mediaCachePolicy is set to FBNativeAdsCachePolicyNone.

    Declaration

    Objective-C
    -(void)downloadMedia;
    Swift
    funcdownloadMedia()