Getting Started

The Audience Network allows you to monetize your iOS apps with Facebook ads. This guide explains how to integrate the Audience Network SDK in an iOS app.

Prerequisites

Ensure that you have the latest Xcode installed.

Please see the FAQ for minimum OS version supported by Audience Network SDK.

Getting Started Steps

Step 1: Download Audience Network SDK

Step 2: Create and Setup Audience Network Sample Project

Known Issues

Step 1: Download Audience Network SDK

The Audience Network SDK can be downloaded using Cocoapods or manually. Follow these steps to download and include it in your project:

Using Cocoapods

  1. Add the following line to your project's Podfile: pod 'FBAudienceNetwork'
  2. Run pod install.

Manual

Step 2: Create and Setup Banner Sample Project

  1. Open XCode, and choose File -> New -> Project ->Single View Application

  2. Set product name to be AudienceNetworkTutorial. Enter your organization name and organization identifier.

    Note that XCode will create a bundle identifier for your project. In this example, the bundle identifier is com.yourcompany.AudienceNetworkTutorial. You will use this bundle identifier later when you submit your app for approval as explained in Submit For Review.

  3. Open the folder where you downloaded the Facebook Audience Network SDK and drag FBAudienceNetwork.framework to your app directory in XCode. Select "Copy Items if needed" and click Finish.

Now You have an empty project with FBAudienceNetwork.framework integrated.

Known Issues

v4.26


When importing FBAudienceNetwork SDK v4.26, you will get an error saying "No Such Module". To fix this issue, you need to rename FBAudienceNetwork.modulemap to module.modulemap in FBAudienceNetwork.framework/Modules folder. This will be fixed in the next release.

Next Steps

  • Explore our code samples which demonstrate how to use native ads. The NativeAdSample is available as part of the SDK and can be found under the FBAudienceNetwork/samples folder. Open the project with Xcode and run it either on a device or the simulator.