# iOS

{% hint style="info" %}
**Current SDK Version: 3.66.1**
{% endhint %}

{% hint style="success" %}
DT FairBid and DT Offer Wall are integrated through the same SDK: the DT FairBid SDK.
{% endhint %}

## Prerequisites <a href="#id-01h52k20xn3w1r8hv3e2teaahs" id="id-01h52k20xn3w1r8hv3e2teaahs"></a>

* Xcode 14.1 or later
* iOS 13 orlater

## Integration <a href="#id-01h52k20xpe4nyqpntbp0y2hzy" id="id-01h52k20xpe4nyqpntbp0y2hzy"></a>

There are three frameworks required to incorporate into your app:

* [FairBid SDK](#id-01h66phhep5pfxsk67y0yn1q14)
* [FMPAdapter.framework](https://github.com/inner-active/FMPAdapter)
* [IASDKCore.framework](#id-01h66phhep5pfxsk67y0yn1q14)

Digital Turbine supports both CocoaPods and manual downloads to integrate the SDK.

### CocoaPods <a href="#id-01h52k20xqbnnha51mgxtat84f" id="id-01h52k20xqbnnha51mgxtat84f"></a>

Add the following line to your `Podfile` and run the `pod install` command:

{% code title="Ruby" %}

```ruby
pod 'FairBidSDK', '~ 3.66.1'
```

{% endcode %}

### Manual Download <a href="#id-01h66phhep5pfxsk67y0yn1q14" id="id-01h66phhep5pfxsk67y0yn1q14"></a>

{% @dt-download-buttons/FairBid-Download-Button-ios %}

1. Download and extract the DT FairBid SDK.
2. Drag and drop `FairBidSDK.xcframework` to your project.\
   The **Choose options for adding these files** window appears:

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2F1YO09AC1tILN1gwOMYcV%2FFairBidSDK.png?alt=media&#x26;token=5b0339f4-11d4-4d90-bbbb-d3e48de9db06" alt=""></div>

3. In the **Action** drop-down list, select **Copy files to destination** and click **Finish**.

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2FC3p1F6JltejY2BoJTbmc%2FScreenshot%202025-01-12%20at%2016.51.47%20(3)%20(3).jpg?alt=media&#x26;token=87947ded-df52-4dd4-8e03-a82f19df4ee3" alt=""></div>

4. Download the [DTX iOS SDK FMPAdapter](https://github.com/inner-active/FMPAdapter).
5. Drag and drop the `FMPAdapter.xcframework` to your project.\
   The **Choose options for adding these files** window appears:
6. In the **Action** drop-down list, select **Copy files to destination** and click **Finish**.

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2F8TIdU8nondRDUwMqTdJB%2FFMPAdapter.png?alt=media&#x26;token=62b9289e-5b6c-477c-9476-5d1bc58cbe0e" alt=""></div>

7. Retrieve the `IASDKCore.framework` from [Integrating the iOS SDK](https://app.gitbook.com/s/8KSLu5HNiyDWpvGRZh7B/publishers/sdk-configuration/integrating-the-ios-sdk) and download the SDK manually.
8. From `DTExchangeSDK`/`iOS`/`IASDKCore`/`IASDKCore.xcframework`, drag and drop the `IASDKCore.xcframework` to your project.\
   The **Choose options for adding these files** window appears:
9. In the **Action** drop-down list, select **Copy files to destination** and click **Finish**.

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2FNEmqRYu0Kzuk0qcHSLUf%2FMarketplace.png?alt=media&#x26;token=78e82dfc-ba5c-4db3-a656-c575582306e5" alt=""></div>

10. From the **General** tab of your Xcode project's target settings page, ensure `DT FairBidSDK`, `FMPAdapter`, and `IASDKCore` frameworks are embedded into your app under **Embed & Sign**.

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2FyocDhgsG81dLc1rYleMz%2FSelected%20area.png?alt=media&#x26;token=edd08aa7-32ca-4d51-be5a-7b4f09e4eb87" alt=""></div>

### Configuring Your Xcode Project <a href="#id-01h52m1583064xsbekg5dntses" id="id-01h52m1583064xsbekg5dntses"></a>

Configuration of the Xcode projects involves the following steps.

1. [Import System Frameworks](#h_01jjhd4yx4hm46twaae8zemnyt).
2. [Disable Multitasking](#h_01jjhd4yx4ke8debtq0n0207em).
3. [Disable the Linked Products Build Flag](#h_01jjhd4yx4g4p6enwe2b0a1558).
4. [App Transport Security](#h_01jjhd4yx4jcr5ze04nfkjkpqv).

#### Importing System Frameworks <a href="#h_01jjhd4yx4hm46twaae8zemnyt" id="h_01jjhd4yx4hm46twaae8zemnyt"></a>

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:

{% tabs %}
{% tab title="Swift" %}

```swift
#import <FairBidSDK/FairBidSDK.h>
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
import FairBidSDK
```

{% endtab %}
{% endtabs %}

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 <a href="#h_01jjhd4yx4ke8debtq0n0207em" id="h_01jjhd4yx4ke8debtq0n0207em"></a>

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:

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2FSo7EKC3DjXeiGEd7mgGK%2F1ab1993-DisableMultitasking.png?alt=media&#x26;token=33b35418-ad09-4ad8-82d8-fa5d67dbc02c" alt=""></div>

#### Disable the Linked Products Build Flag <a href="#h_01jjhd4yx4g4p6enwe2b0a1558" id="h_01jjhd4yx4g4p6enwe2b0a1558"></a>

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**:

<div align="left" data-with-frame="true"><img src="https://2654615282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4IftQ9WUOy9feTA5sZeE%2Fuploads%2FYeTRstKE6Rd5kCYgtXkl%2Fmceclip2.png?alt=media&#x26;token=d75d64b2-9619-4855-ab04-6bdc91bd1323" alt=""></div>

#### App Transport Security <a href="#h_01jjhd4yx4jcr5ze04nfkjkpqv" id="h_01jjhd4yx4jcr5ze04nfkjkpqv"></a>

App Transport Security (ATS) Settings is an Apple security feature that enforces HTTPS connections. Make sure you disable this by setting the **Allow Arbitrary Loads** property to **Yes** so that you get the HTTP traffic as well. For more information, see [ATS Configuration for DT Exchange SDK](https://app.gitbook.com/s/8KSLu5HNiyDWpvGRZh7B/publishers/sdk-configuration/integrating-the-ios-sdk/ats-configuration-for-dt-exchange-sdk).

## Adding Third-Party SDKs <a href="#h_01jjhakjtsgj4dj0fz6znm5xmd" id="h_01jjhakjtsgj4dj0fz6znm5xmd"></a>

In addition to integrating the DT FairBid SDK you must integrate chosen third-party networks' SDKs into their app.

* Set up your app in the network's dashboard and in the DT Console. For more information, see [Setting Up DT FairBid.](https://docs.digitalturbine.com/dt-fairbid/getting-started-with-dt-fairbid/setting-up-your-app-in-the-dt-console)
* Download the relevant network's SDK. For more information about supported networks and their SDKs, see [Supported Networks](https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/supported-networks).
  * You must add additional configurations for each third-party network.
  * These entries are found by selecting your third-party networks in the table.

{% hint style="info" %}
The DT FairBid SDK automatically detects and initializes SDKs from third-party networks.
{% endhint %}

Once you've added all third-party SDKs and [set up your app in the console](https://docs.digitalturbine.com/dt-fairbid/getting-started-with-dt-fairbid/setting-up-your-app-in-the-dt-console), you can [initialize the DT Fairbid SDK](https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/initializing-the-sdk).

{% hint style="success" %}
The SKAdNetwork ID list may change over time. To ensure you have the most current information, DT recommends integrating the [SKAdNetwork ID Auto Updater Tool](https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/sdk-reference/skadnetwork-id-auto-updater) into your build.
{% endhint %}
