This guide is one of four that explains how to integrate the DT FairBid SDK for Android, iOS, and Unity apps. Android and iOS require platform-specific setup, whereas Unity uses plug-ins for integration to simplify the process and ensure cross-platform compatibility. Select the appropriate tab to access platform-specific requirements, setup procedures, and integration methods.
- SDK Integration (this guide)
- Setting-Up DT Fairbid (in the DT Console)
- Initializing the SDK
- Ad Formats (adding the ads to your app)
Android
Current SDK Version
- 3.56.0
Note that since version 3.41.0, DT FairBid and DT Offer Wall are integrated through the same SDK - the DT FairBid SDK.
Prerequisites
- Android 4.1 (API Level 16)+
- Google Play Services 11.4.0+
Integration
DT supports both Gradle dependencies and manual downloads to integrate the SDK.
Gradle
Add DT Maven repository and plugins to your gradle build script:
- Add the following to your project's root level
build.gradle
file inside the repositories section. - At the root level
build.gradle
file, there are usually two repository sections - one forbuildscript
and one forallprojects
. Add the entry inallprojects
:
allprojects {
repositories {
mavenCentral()
}
...
}
- Add the following to the project app-level
build.gradle
file inside the plugins section (For additional information, see Types of Gradle Plugins):
plugins {
...
id 'com.fyber.fairbid-sdk-plugin' version '3.56.0'
...
}
- If you support Android SDK below 26, add the following snippet to the Android section (for Java Version Compatibility):
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
...
}
Manual Download
- Download the DT FairBid SDK.
- Extract the file.
- Import the .aar packages into your project.
Optional Permissions
The following permissions are not required for our SDK or 3rd-party SDKs to function, but including them in your AndroidManifest.xml may result in improved eCPM and user experience:
<!-- Optionally used by FairBid -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Adding 3rd Party SDKs
In addition to integrating the DT FairBid SDK, publishers who are using DT FairBid Mediation, must integrate chosen 3rd-party networks' SDKs into their app.
- Set up your app in the network's dashboard and in the DT Console. A step-by-step guide can be found here.
- Download the relevant network's SDK. Supported networks and their SDKs can be found here.
- You must add additional configurations for each third party network.
- These entries are found by selecting your third party networks in the table.
Important
The DT FairBid SDK automatically detects and initializes SDKs from 3rd-party networks.
Once you've added all third party SDKs and set-up your app in the console, you can go ahead and initialize the DT Fairbid SDK.
iOS
Current SDK Version
- 3.56.0
Note that since version 3.41.0, DT FairBid and DT Offer Wall are integrated through the same SDK - the DT FairBid SDK.
Prerequisites
- Xcode 14.1+
- iOS 11+
Integration
There are three frameworks required to incorporate into your app:
Digital Turbine supports both CocoaPods and manual downloads to integrate the SDK.
CocoaPods
Add the following line to your Podfile and run the pod install command:
pod 'FairBidSDK', '~ 3.56.0'
Manual Download
- Download and extract the DT FairBid SDK.
- Drag and drop
FairBidSDK.framework
to your project and select the Copy items if needed checkbox.
- Download the DTX iOS SDK FMPAdapter.
- Drag and drop the
FMPAdapter.framework
to your project and select the Copy items if needed checkbox.
-
Retrieve the
IASDKCore.framework
from Integrating the iOS SDK and download the SDK manually. - From
DTExchangeSDK
/iOS
/IASDKCore
/IASDKCore.xcframework
, drag and drop theIASDKCore.framework
to your project and select the Copy items if needed checkbox.
- From the General tab of your Xcode project's target settings page, ensure
DT FairBidSDK
,FMPAdapter
, andIASDKCore
frameworks are embedded into your app under Embed & Sign.
Configuring Your Xcode Project
Configuration of the Xcode projects involves the following steps.
- Import System Frameworks.
- Disable Multitasking.
- Disable the Linked Products Build Flag.
- App Transport Security.
- Enable Global Permissions.
Importing System Frameworks
If the Enable Modules (CLANG_ENABLE_MODULES
) option is active in the project's Build Settings; there's no need to import any frameworks manually. Import the DT FairBid framework umbrella header in your code, for example, in the AppDelegate class:
#import <FairBidSDK/FairBidSDK.h>
Objective-C
import FairBidSDK
If you cannot enable modules, you might need to add the following frameworks to the Frameworks, Libraries and Embedded Content section in Xcode:
AdSupport
CoreGraphics
CoreLocation
CoreTelephony
MediaPlayer
MessageUI
MobileCoreServices
QuartzCore
Security
StoreKit
SystemConfiguration
Disable Multitasking
Select the Requires full-screen checkbox from the General tab of your Xcode project's target settings page.
This disables multitasking support, which must be disabled for ads to be able to set the orientation of their views:
Disable the Linked Products Build Flag
By default, Xcode strips libraries linked to the project. This may result in symbols missing for some ad networks, and subsequently, the DT 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 HTTPS for all networking apps. As of 2017, Apple requires that all apps use ATS unless they state a reason for being unable to.
All third-party networks fully support ATS and do not require any additional configuration.
Important
Starting from iOS 10.0, if the following two keys are present in the info.plist
,
NSAllowsArbitraryLoadsInWebContent
NSAllowsArbitraryLoads
Then NSAllowArbitraryLoadsInWebContent
will override NSAllowsArbitraryLoads
. If you require global permission, keep only the NSAllowArbitraryLoads
with YES in your .plist file, and delete the NSAllowArbitraryLoadsInWebContent
key.
The same applies for the following keys:
NSAllowsArbitraryLoadsForMedia
NSAllowsLocalNetworking
In addition, it is important to understand that the NSAllowsArbitraryLoadsForMedia
does not exclude VAST videos, in terms of ATS. It does not have any effect on the DT Exchange SDK and only overrides the global NSAllowsArbitraryLoads
key, which results in a secure request, even when it was not intended to do so.
Enabling Global Permissions
To enable global permission to a non-secure HTTP request, add the following key and value to your Info.plist
file by opening the file as a property list:
*Key*
App Transport Security Settings
*Type*
Allow Arbitrary Loads
*Value*
YES
Alternatively, you can add XML directly to the Info.plist
file source code:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
After you add the ATS to the Info.plist
file, it should look like this:
Adding 3rd Party SDKs
In addition to integrating the DT FairBid SDK, publishers who are using DT FairBid Mediation, must integrate chosen 3rd-party networks' SDKs into their app.
- Set up your app in the network's dashboard and in the DT Console. A step-by-step guide can be found here.
- Download the relevant network's SDK. Supported networks and their SDKs can be found here.
- You must add additional configurations for each third party network.
- These entries are found by selecting your third party networks in the table.
Important
The DT FairBid SDK automatically detects and initializes SDKs from 3rd-party networks.
Once you've added all third party SDKs and set-up your app in the console, you can go ahead and initialize the DT Fairbid SDK.
Unity
Current Plugin Version
- 3.56.0
Note that since version 3.47.0, DT FairBid and DT Offer Wall are integrated through the same Unity Plugin - the DT FairBid Unity Plugin.
Prerequisites
- Android 4.1 (API level 16)+ (when building for Android)
- iOS 11+ (when building for iOS)
- Unity 2020 LTS or later
Important
The DT FairBid Unity Plugin can only be integrated into iOS projects from a Mac - you cannot build your iOS/Xcode project on Windows.
Integration
Digital Turbine supports two methods for the integration in Unity:
Integrating Through Unity's Package Manager
Tip
This is the recommended method to integrate the DT FairBid Unity Plugin in your Unity project.
The DT FairBid Unity Plugin is provided as a package in the NPM package registry. This package is imported using Unity Package Manager.
To import the package:
- Add the following entries inside your manifest.json file, which you can find under the Packages folder:
-
- Add an entry under
scopedRegistries
. Unity knows where to search when adding the DT FairBid Unity Plugin dependency. This entry points to the NPM package registry.
- Add an entry under
{
…
"scopedRegistries": [
{
"name": "npmjs",
"url": "https://registry.npmjs.org/",
"scopes": [
"com.fyber.fairbid.unity"
]
}
…
],
…
}
-
- Add an entry under
dependencies
, which references the DT FairBid Unity Plugin version that you intend to integrate.
- Add an entry under
{
…
"dependencies": {
"com.fyber.fairbid.unity": "3.56.0",
…
}
…
}
- Save the changes and open your Unity 3D Project.
The Unity Package Manager resolves the dependencies, and now the DT FairBid Unity Plugin is integrated into the project. - To cross-check the integration of DT FairBid, navigate to the Unity 3D Window toolbar menu and click Package Manager.
The Package Manager window shows DT FairBid under the DT section and the DT FairBid Unity Plugin version.
You can also change the DT FairBid Unity Plugin version you are integrating through the Unity Package Manager.
Importing DT FairBid Unity Plugin Raw Package
Follow the instructions below to download the DT FairBid Unity Plugin package manually.
Manual Download
Removing Current Plugin
If you are updating the Plugin:
- Make sure there is no trace of the previous version of the DT FairBid Unity Plugin.
- Remove the FairBid folder.
This is a fail-safe way to ensure no legacy file is left behind:
Importing New Plugin
- Download the DT FairBid Unity Plugin.
- Unzip the downloaded files.
- Add the FairBid.unitypackage to your open Unity project.
Once you've added the DT FairBid Unity Plugin and set up your app in the console, you can initialize and show the DT Offer Wall.
Adding 3rd Party SDKs
In addition to integrating the DT FairBid SDK, publishers who are using DT FairBid Mediation, must integrate chosen 3rd-party networks' SDKs into their app.
- Set up your app in the network's dashboard and in the DT Console. A step-by-step guide can be found here.
- Download the relevant network's SDK. Supported networks and their SDKs can be found here.
- You must add additional configurations for each third party network.
- These entries are found by selecting your third party networks in the table.
Important
The DT FairBid SDK automatically detects and initializes SDKs from 3rd-party networks.
Once you've added all third party SDKs and set-up your app in the console, you can go ahead and initialize the DT Fairbid SDK.