# Unity

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

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

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

* Android 4.4 (API Level 19) or later
* iOS 13 or later
* Unity 2021 or later

{% hint style="danger" %}
Integrating DT FairBid for Unity iOS development requires a macOS environment. Building your iOS/Xcode project is not supported on Windows.
{% endhint %}

### Tooling <a href="#h_01jqf2dk4qh60s5wf7zn6p2xr4" id="h_01jqf2dk4qh60s5wf7zn6p2xr4"></a>

When integrating the FairBid SDK into your Unity app, make sure your development environment meets the following minimum compatibility requirements.

| UNITY EDITOR | ANDROID SDK  | KOTLIN | GRADLE | JDK | AGP   |
| ------------ | ------------ | ------ | ------ | --- | ----- |
| 2022.3       | API Level 19 | 2.1.0  | 7.6.3  | 11  | 7.4.2 |
| 2021.3       | API Level 19 | 2.1.0  | 7.6.3  | 11  | 7.4.2 |

While FairBid *may* work with other Unity Editor versions, DT tests FairBid against these specific versions. Additionally, the recommended tooling (JDK, Gradle, and AGP) versions reflect the defaults included with each Unity version. These can be overridden, but DT recommends using these versions to avoid conflicts in your build process.

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

Digital Turbine supports two methods for integration in Unity:

* [Integrating through Unity's Package Manager](#id-01h54c060kv9r4vsde3fbb311r) (recommended)
* [Importing FairBid Unity Plugin Raw Package](#id-01h54c060k0besyr5g23dxwkj1)

### Integrating Through Unity's Package Manager <a href="#id-01h54c060kv9r4vsde3fbb311r" id="id-01h54c060kv9r4vsde3fbb311r"></a>

{% hint style="info" %}
This is the recommended method to integrate the DT FairBid Unity Plugin in your Unity project.
{% endhint %}

The DT FairBid Unity Plugin is provided as a package in the [NPM](https://www.npmjs.com/package/com.fyber.fairbid.unity) package registry. This package is imported using Unity Package Manager.

To import the package:

1. Add the following entries inside your `manifest.json`, 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.

{% code title="JSON" %}

```json
{
    …
    "scopedRegistries": [
        {
            "name": "npmjs",
            "url": "https://registry.npmjs.org/",
            "scopes": [
                "com.fyber.fairbid.unity"
            ]
        }
        …
      ],
    …
}
```

{% endcode %}

* Add an entry under `dependencies`, which references the DT FairBid Unity Plugin version that you intend to integrate.

{% code title="JSON" %}

```json
{
    …
    "dependencies": {
        "com.fyber.fairbid.unity": "3.66.1",
        …
    }
    …
}  
```

{% endcode %}

2. 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.
3. 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 <a href="#id-01h54c060k0besyr5g23dxwkj1" id="id-01h54c060k0besyr5g23dxwkj1"></a>

Follow the instructions below to download the DT FairBid Unity Plugin package manually.

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

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

#### Removing Current Plugin <a href="#id-01h54c060kcqbng41wm84vx71p" id="id-01h54c060kcqbng41wm84vx71p"></a>

If you are updating the Plugin:

1. Make sure there is no trace of the previous version of the DT FairBid Unity Plugin.
2. Remove the `FairBid` folder.

This is a fail-safe way to ensure no legacy file is left behind:

<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%2FQEOtG0qJ1tyWgIVmvQLx%2F67626ea-Unity1.png?alt=media&#x26;token=b8a5965b-f60d-4022-bdec-800f1234a599" alt=""></div>

#### Importing New Plugin <a href="#id-01h54c060kcyca4kqkdmjn5e0w" id="id-01h54c060kcyca4kqkdmjn5e0w"></a>

1. Download the DT FairBid Unity Plugin.
2. Unzip the downloaded files.
3. Add the `FairBid.unitypackage` to your open Unity project.

## 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).
