iOS SDK Version
FBNativeAdBase
Objective-C
@interfaceFBNativeAdBase:NSObject
Swift
classFBNativeAdBase:NSObject
The Internal representation of an Ad
- Typed access to the id of the ad placement.
Declaration
Objective-C@property(nonatomic,copy,readonly)NSString*_NonnullplacementID;
SwiftvarplacementID:String{get}
- Typed access to the headline that the advertiser entered when they created their ad. This is usually the ad’s main title.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*headline;
Swiftvarheadline:String?{get}
- Typed access to the link description which is additional information that the advertiser may have entered.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*linkDescription;
SwiftvarlinkDescription:String?{get}
- Typed access to the name of the Facebook Page or mobile app that represents the business running the ad.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*advertiserName;
SwiftvaradvertiserName:String?{get}
- Typed access to the ad social context, for example “Over half a million users”.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*socialContext;
SwiftvarsocialContext:String?{get}
- Typed access to the call to action phrase of the ad, for example “Install Now”.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*callToAction;
SwiftvarcallToAction:String?{get}
- Typed access to the body raw untruncated text, Contains the text that the advertiser entered when they created their ad. This often tells people what the ad is promoting.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*rawBodyText;
SwiftvarrawBodyText:String?{get}
- Typed access to the body text, truncated at length 90, which contains the text that the advertiser entered when they created their ad. This often tells people what the ad is promoting.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*bodyText;
SwiftvarbodyText:String?{get}
- Typed access to the word ‘sponsored’, translated into the language being used by the person viewing the ad.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*sponsoredTranslation;
SwiftvarsponsoredTranslation:String?{get}
- Typed access to the word ‘ad’, translated into the language being used by the person viewing the ad.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*adTranslation;
SwiftvaradTranslation:String?{get}
- Typed access to the word ‘promoted’, translated into the language being used by the person viewing the ad.
Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*promotedTranslation;
SwiftvarpromotedTranslation:String?{get}
- Typed access to the AdChoices icon. See
FBAdImage
for details. SeeFBAdChoicesView
for an included implementation. - Typed access to the icon image. Only available after ad is successfully loaded.
Declaration
Objective-C@property(nonatomic,strong,readonly,nullable)UIImage*iconImage;
SwiftvariconImage:UIImage?{get}
- Aspect ratio of the ad creative.
Declaration
Objective-C@property(nonatomic,readonly)CGFloataspectRatio;
SwiftvaraspectRatio:CGFloat{get}
- Typed access to the AdChoices URL. Navigate to this link when the icon is tapped. See
FBAdChoicesView
for an included implementation.Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSURL*adChoicesLinkURL;
SwiftvaradChoicesLinkURL:URL?{get}
- Typed access to the AdChoices text, usually a localized version of “AdChoices”. See
FBAdChoicesView
for an included implementation.Declaration
Objective-C@property(nonatomic,copy,readonly,nullable)NSString*adChoicesText;
SwiftvaradChoicesText:String?{get}
- Typed access to the ad format type. See
FBAdFormatType
enum for more details.Declaration
Objective-C@property(nonatomic,readonly)FBAdFormatTypeadFormatType;
SwiftvaradFormatType:FBAdFormatType{get}
- Read only access to native ad caching policy, it is set in loadAWithMediaCachePolicy:
Declaration
Objective-C@property(nonatomic,readonly)FBNativeAdsCachePolicymediaCachePolicy;
SwiftvarmediaCachePolicy:FBNativeAdsCachePolicy{get}
- Call isAdValid to check whether native ad is valid & internal consistent prior rendering using its properties. If rendering is done as part of the loadAd callback, it is guarantee to be consistent
Declaration
Objective-C@property(nonatomic,readonly,getter=isAdValid)BOOLadValid;
SwiftvarisAdValid:Bool{get}
- Undocumented
Declaration
Objective-C@property(nonatomic,getter=isRegistered,readonly)BOOLregistered
SwiftvarisRegistered:Bool{get}
- FBAdExtraHint to provide extra info
Declaration
Objective-C@property(nonatomic,strong,nullable)FBAdExtraHint*extraHint;
SwiftvarextraHint:FBAdExtraHint?{getset}
- This is a method to disconnect a FBNativeAd with the UIView you used to display the native ads.
Declaration
Objective-C-(void)unregisterView;
SwiftfuncunregisterView()
- Begins loading the FBNativeAd content.You can implement
nativeAdDidLoad:
andnativeAd:didFailWithError:
methods ofFBNativeAdDelegate
if you would like to be notified as loading succeeds or fails.Declaration
Objective-C-(void)loadAd;
SwiftfuncloadAd()
- Begins loading the FBNativeAd content.You can implement
nativeAdDidLoad:
andnativeAd:didFailWithError:
methods ofFBNativeAdDelegate
if you would like to be notified as loading succeeds or fails.Declaration
Objective-C-(void)loadAdWithMediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy;
SwiftfuncloadAd(withMediaCachePolicymediaCachePolicy:FBNativeAdsCachePolicy)
Parameters
- Begins loading the FBNativeAd content from a bid payload attained through a server side bid.
Declaration
Objective-C-(void)loadAdWithBidPayload:(nonnullNSString*)bidPayload;
SwiftfuncloadAd(withBidPayloadbidPayload:String)
Parameters
- Begins loading the FBNativeAd content from a bid payload attained through a server side bid.
Declaration
Objective-C-(void)loadAdWithBidPayload:(nonnullNSString*)bidPayloadmediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy;
SwiftfuncloadAd(withBidPayloadbidPayload:String,mediaCachePolicy:FBNativeAdsCachePolicy)
Parameters
- Creates a new instance of a FBNativeAdBase from a bid payload. The actual subclass returned will depend on the contents of the payload.
Declaration
Objective-C+(nullableinstancetype)nativeAdWithPlacementId:(nonnullNSString*)placementIdbidPayload:(nonnullNSString*)bidPayloaderror:(NSError*_Nullable*_Nullable)error;
SwiftclassfuncnativeAd(withPlacementIdplacementId:String,bidPayload:String)throws->Self
Parameters