iOS SDK Version
FBNativeAd
Objective-C
@interfaceFBNativeAd:FBNativeAdBase
Swift
classFBNativeAd: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,nullable)id<FBNativeAdDelegate>delegate;
Swiftweakvardelegate:FBNativeAdDelegate?{getset}
- Undocumented
Declaration
Objective-C-(instancetype)initWithPlacementID:(NSString*)placementID;
Swiftinit(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;
SwiftfuncregisterView(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;
SwiftfuncregisterView(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;
SwiftfuncregisterView(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;
SwiftfuncregisterView(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;
SwiftfuncdownloadMedia()