Current SDK Version: 3.21.1
This guide is intended for developers who are integrating the FairBid SDK with an iOS app. After you have integrated the SDK, choose the relevant ad format and follow the steps for implementing that format.
- Xcode 13+
- iOS 10+
Step 1: Integration
Fyber supports both CocoaPods and manual download to integrate our SDK:
Add the following line to your Podfile and run the pod install command
pod 'FairBidSDK', '~> 3.21.1'
- Download the FairBid SDK
- Extract it.
- Drag and drop FairBidSDK.framework to your project. Ensure Copy items if needed checked.
- From the General tab of your Xcode project's target settings page, ensure the FairBidSDK framework is embedded into your app.
- Select the Build Phases tab and click the plus sign (+).
- Select New Run Script Phase and paste the following snipped into the script editor field:
New Run Script Phase
This Run Script phase must appear below the Embed Frameworks phase.
The FairBid iOS SDK contains both ARM and x86 code, allowing the SDK to work on devices and simulators.
The script strips the Simulator slices allowing the app to be submitted to the App Store
Step 2: Configuring Your Xcode Project
The next step in the process is to configure your Xcode Project.
Importing System Frameworks
If the option Enable Modules (CLANG_ENABLE_MODULES) is active in the project's Build Settings, there's no need to import any frameworks manually. All you have to do is to import the FairBid framework umbrella header in your code, for example in the AppDelegate class:
If you cannot enable modules, you might need to add these frameworks to the Frameworks, Libraries and Embedded Content section in Xcode:
From the General tab of your Xcode project's target settings page, check the box labeled Requires full screen (this disables multitasking support, which must be disabled for ads to be able to set the orientation of their views):
Strip Linked Products Build Flag
By default, Xcode strips libraries linked to the project. This may result in symbols missing for some ad networks. FairBid SDK may not behave as expected.
To avoid this, set Strip Linked Products (STRIP_INSTALLED_PRODUCT) build flag to No:
App Transport Security
iOS 9 added App Transport Security (ATS), which requires apps to use HTTPS for all networking. As of 2017, Apple requires that all apps use ATS unless they state a reason they are unable to do so.
All of the 3rd networks that can be used with FairBid fully support ATS, and do not require any additional configuration.
Starting from the iOS 10.0, if there are two keys present in the info.plist - both NSAllowsArbitraryLoadsInWebContent and NSAllowsArbitraryLoads, the NSAllowsArbitraryLoads has no effect.
If you require global permission, keep only the NSAllowArbitraryLoads with YES in your .plist file, and delete the NSAllowArbitraryLoadsInWebContent key. Otherwise, it doesn't work since the NSAllowArbitraryLoadsInWebContent cancels out the previous one.
The same applies for the following keys:
In addition, it is important to understand, that the NSAllowsArbitraryLoadsForMedia does not exclude the VAST videos, in terms of ATS. It does not have any effect on the Fyber Marketplace SDK and only overrides the global NSAllowsArbitraryLoads key, which results in a secure request, even it was not intended to do so.
Enabling Global Permissions
To enable a global permission to a non-secured HTTP request, add the following to your Info.plist file:
Add the key and value to the file Info.plist if you open the file as property list.
*Key* App Transport Security Settings *Type* Allow Arbitrary Loads *Value* YES
Alternatively, if you want to add directly to the source code of the file - Info.plist.
After adding the ATS to the file - Info.plist.
Step 3: Privacy Enhancements and MRAID (optional)
You may statically declare your app’s intended usage of protected data classes by including the appropriate purpose string keys in your Info.plist file.
- Search for the following code in your Info.plist:
Privacy Enhancements and MRAID
“Privacy - Calendars Usage Description” “Privacy - Photo Library Additions Usage Description” “Privacy - Photo Library Usage Description”
Step 4: Adding 3rd Party SDKs
In addition to integrating the FairBid SDK, publishers who are using FairBid Mediation, must integrate chosen 3rd-party networks' SDKs into their app.