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;
    Swift
    varplacementID: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;
    Swift
    varheadline: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;
    Swift
    varlinkDescription: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;
    Swift
    varadvertiserName: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;
    Swift
    varsocialContext: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;
    Swift
    varcallToAction: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;
    Swift
    varrawBodyText: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;
    Swift
    varbodyText: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;
    Swift
    varsponsoredTranslation: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;
    Swift
    varadTranslation: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;
    Swift
    varpromotedTranslation:String?{get}
  • Typed access to the AdChoices icon. See FBAdImage for details. See FBAdChoicesView for an included implementation.

    Declaration

    Objective-C
    @property(nonatomic,strong,readonly,nullable)FBAdImage*adChoicesIcon;
    Swift
    varadChoicesIcon:FBAdImage?{get}
  • Typed access to the icon image. Only available after ad is successfully loaded.

    Declaration

    Objective-C
    @property(nonatomic,strong,readonly,nullable)UIImage*iconImage;
    Swift
    variconImage:UIImage?{get}
  • Aspect ratio of the ad creative.

    Declaration

    Objective-C
    @property(nonatomic,readonly)CGFloataspectRatio;
    Swift
    varaspectRatio: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;
    Swift
    varadChoicesLinkURL: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;
    Swift
    varadChoicesText:String?{get}
  • Typed access to the ad format type. See FBAdFormatType enum for more details.

    Declaration

    Objective-C
    @property(nonatomic,readonly)FBAdFormatTypeadFormatType;
    Swift
    varadFormatType:FBAdFormatType{get}
  • Read only access to native ad caching policy, it is set in loadAWithMediaCachePolicy:

    Declaration

    Objective-C
    @property(nonatomic,readonly)FBNativeAdsCachePolicymediaCachePolicy;
    Swift
    varmediaCachePolicy: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;
    Swift
    varisAdValid:Bool{get}
  • Undocumented

    Declaration

    Objective-C
    @property(nonatomic,getter=isRegistered,readonly)BOOLregistered
    Swift
    varisRegistered:Bool{get}
  • FBAdExtraHint to provide extra info

    Declaration

    Objective-C
    @property(nonatomic,strong,nullable)FBAdExtraHint*extraHint;
    Swift
    varextraHint: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;
    Swift
    funcunregisterView()
  • Begins loading the FBNativeAd content.
    You can implement nativeAdDidLoad: and nativeAd:didFailWithError: methods of FBNativeAdDelegate if you would like to be notified as loading succeeds or fails.

    Declaration

    Objective-C
    -(void)loadAd;
    Swift
    funcloadAd()
  • Begins loading the FBNativeAd content.
    You can implement nativeAdDidLoad: and nativeAd:didFailWithError: methods of FBNativeAdDelegate if you would like to be notified as loading succeeds or fails.

    Declaration

    Objective-C
    -(void)loadAdWithMediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy;
    Swift
    funcloadAd(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;
    Swift
    funcloadAd(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;
    Swift
    funcloadAd(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;
    Swift
    classfuncnativeAd(withPlacementIdplacementId:String,bidPayload:String)throws->Self

    Parameters