Minimum iOS SDK version support

From this new release, the minimum iOS version for receiving Audience Network ads is iOS 9 and above. iOS 8 and below will not receive ads and the SDK will return a NO FILL error message. You can refer to Audience Network FAQ guide for more information about minimum OS version support.

What's New?

  1. We added FBNativeBannerAd and FBAdIconView in the iOS SDK 4.99 release. FBNativeBannerAd is used for showing a native ad without the ad image or video. FBNativeBannerAd must use the FBAdIconView class to display the ad icon and it is required to show the ad title, ad CTA button, and AdChoices icon to users.

    If using FBNativeBannerAd, you will need to select the 'Native banner' format for your placement in Monetization Manager. If you are updating from FBNativeAd to FBNativeBannerAd you may continue to use the same placement, but you will need to update the format type.





    You can refer to Audience Network iOS API reference and Native Banner Ads integration guide for more details about how to use these two new interfaces.

  2. We have a new requirement for showing a native ad in the app. When requesting a FBNativeAd ad instance, the FBMediaView view instance is required to show the ad image, video or carousel content. You can check our latest Native Ads developer doc for more information.

  3. We added downloadMedia methods in FBNativeAd and FBNativeBannerAd interfaces. This is used when mediaCachePolicy property is set to FBNativeAdsCachePolicyNone. We added nativeAdDidDownloadMedia: delegate method in FBNativeAdDelegate and nativeBannerAdDidDownloadMedia: delegate method in FBNativeBannerAdDelegate. They are called when media content is successfully downloaded.

  4. We added following new properties in the FBNativeAd and FBNativeBannerAd interfaces:

    Property Name Description

    headline

    Shows the headline that the advertiser entered when they created their ad. This is usually the ad's main title.

    linkDescription

    Shows additional information that the advertiser may have entered.

    advertiserName

    Shows the name of the Facebook Page or mobile app that represents the business running each ad.

    rawBodyText

    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.

    bodyText

    Shows the text that the advertiser entered when they created their ad. This often tells people what the ad is promoting.

    sponsoredTranslation

    Shows the word 'sponsored', translated into the language based upon Facebook app language setting.

    adTranslation

    Shows the word 'ad', translated into the language based upon Facebook app language setting.

    promotedTranslation

    Shows the word 'promoted', translated into the language based upon Facebook app language setting.

  5. We also added a new view interface called FBNativeBannerAdView, which shows a native banner ad using a template. This is similar to FBNativeAdView interface, except it does not show ad image, video or carousel content. There are two different height options, FBNativeBannerAdViewTypeGenericHeight100 and FBNativeBannerAdViewTypeGenericHeight120.



    You can refer to Audience Network iOS API reference and Native Ads template guide for more details about how to use these two new interfaces.

What has changed?

In this new release, a few APIs has been changed for better ad quality.

  1. registerViewForInteraction:viewController:clickableViews: signature changed to registerViewForInteraction:mediaView:iconView:viewController:clickableViews: The method now takes a mandatory FBMediaView and a optional FBAdIconView

  2. registerViewForInteraction:viewController: signature changed to registerViewForInteraction:mediaView:iconView:viewController: The method now takes a mandatory FBMediaView and a optional FBAdIconView

  3. mediaCachePolicy on FBNativeAd is now a readonly property. The mediaCachePolicy is now set when loading an ad with the new methods loadAdWithMediaCachePolicy: or loadAdWithBidPayload:mediaCachePolicy:

  4. rawBody on FBNativeAd is renamed to rawBodyText

  5. body on FBNativeAd is renamed to bodyText

What has been removed?

In this new release, we have removed some APIs for better ad quality.

  1. setAutoplayEnabled is removed from FBMediaView interface. Your app can still call isAutoplayEnabled to check if video play is auto played by FBMediaView.

  2. FBNativeAdsCachePolicyIcon, FBNativeAdsCachePolicyCoverImage, FBNativeAdsCachePolicyVideo, and FBNativeAdsCachePolicyAdChoices are removed from mediaCachePolicy properties of FBNativeAdsManager, FBNativeAd, and FBNativeAdBase interfaces. Only FBNativeAdsCachePolicyNone and FBNativeAdsCachePolicyAll are supported.

  3. disableAutoRefresh is removed from FBAdView interface and auto refresh for banner ads is no longer supported.

  4. FBNativeAdViewTypeGenericHeight100 and FBNativeAdViewTypeGenericHeight120 are removed from FBNativeAdViewType enum.

  5. title has been removed from FBNativeAd

  6. subtitle has been removed from FBNativeAd

Migration Steps

Remove the older version of Audience Network iOS SDK from your Xcode project and replace with the latest one downloaded from the change log. Follow the four use cases below about showing native ads in your app.

Apps using NativeAd and FBMediaView to show ad media

  1. If your app shows native ads and uses FBMediaView interface to show ad image, video or carousel content, remove all references that call setNativeAd method from FBMediaView instance. You need to register FBMediaView instance to FBNativeAd instance with the following:

    Replace registerViewForInteraction:withViewController with registerViewForInteraction:mediaView:viewController.
    Or replace registerViewForInteraction:withViewController:withClickableViews with registerViewForInteraction:mediaView :viewController:clickableViews

  2. Code to show native ads before:
    // Create FBMediaView property and configure in storyboard or init with frame
    @property (nonatomic, strong) IBOutlet FBMediaView *adCoverMediaView;
    
    //Need to remove setNativeAd as it's not supported in 4.99 release
    [self.adCoverMediaView setNativeAd:nativeAd];
    
    NSArray<UIView *> *clickableViews = @[self.adCallToActionButton,self.adCoverMediaView];
    [nativeAd registerViewForInteraction:self.adUIView
                      withViewController:self
                      withClickableViews:clickableViews];
    Code to show native ads using iOS 4.99 release:
    // Create FBMediaView property and configure in storyboard or init with frame
    @property (nonatomic, strong) IBOutlet FBMediaView *adCoverMediaView;
    
    // Create FBAdIconView property and configure in storyboard or init with frame
    @property (nonatomic, strong) IBOutlet FBAdIconView *adIconView;
    
    // Register FBMediaView object with FBNativeAd object
    NSArray<UIView *> *clickableViews = @[self.adIconView, self.adTitleLabel, self.adSocialContextLabel, self.adCallToActionButton];
    [nativeAd registerViewForInteraction:self.adUIView
                               mediaView:self.adCoverMediaView
                                iconView:self.adIconView
                          viewController:self
                          clickableViews:clickableViews];
  3. If your app shows ad icon, you need to remove the reference as FBAdImage *icon is no longer supported. To show ad icon, you need to create a view instance with FBAdIconView type and calls registerViewForInteraction:mediaView:iconView:viewController method

    Code to show ad icon before:
    // Create UIImageView property and configure in storyboard or init with frame
    @property (nonatomic, strong) IBOutlet UIImageView *adIconView;
    
    // Load ad icon image
    __weak typeof(self) weakSelf = self;
    [self.nativeAd.icon loadImageAsyncWithBlock:^(UIImage *image) {
        __strong typeof(self) strongSelf = weakSelf;
        strongSelf.adIconView.image = image;
    }];
    Code to show ad icon using iOS 4.99 release:
    // Create FBAdIconView property and configure in storyboard or init with frame
    @property (nonatomic, strong) IBOutlet FBAdIconView *adIconView;
    
    // Register FBAdIconView object with FBNativeAd object
    NSArray<UIView *> *clickableViews = @[self.adIconView, self.adTitleLabel, self.adSocialContextLabel, self.adCallToActionButton];
    [nativeAd registerViewForInteraction:self.adUIView
                               mediaView:self.adCoverMediaView
                                iconView:self.adIconView
                          viewController:self
                          clickableViews:clickableViews];

Apps using FBNativeAd and FBAdImage to show ad image

  1. FBAdImage *coverImage property is removed from FBNativeAd in the latest release. Remove all references of coverImage from your app.

  2. If your app uses UIImageView equivalent views to show ad images, you need to replace them with FBMediaView and follow the steps described in the above scenario.

Apps showing native ads excluding ad media

  1. At minimum, to show native ads, your app needs to include the ad title, CTA button, advertiser icon, and AdChoices icon. Refer to Implementation Requirements for Audience Network Ads for more details.


  2. If your app does not show advertiser assets including image, video or carousel content, you can use FBNativeBannerAd and FBAdIconView to show native ads with the banner equivalent format.

    You can refer to Audience Network iOS API reference and Native Banner Ads integration guide for more details about how to use these two new interfaces.

Apps using FBNativeAdView to show native ad template

If your app shows a native ad template using FBNativeAdView, FBNativeAdViewTypeGenericHeight100 and FBNativeAdViewTypeGenericHeight120 are not supported by FBNativeAdView and FBNativeAdViewType from this new release.


You can refer to Native Ads template for more details about how to show a native template ad with 100 and 120 height options using FBNativeBannerAdView