Unity SDK Integration

893ad6d-Unity_icon.png

Current SDK Version: 3.31.0

 

Introduction

This guide is intended for developers who are integrating the DT FairBid SDK with a Unity app.

Prerequisites

  • Android 4.1 (API level 16)+ (when building for Android)
  • iOS 9.0+ (when building for iOS)
  • Unity 2019 LTS or later

Important

  • The DT FairBid Unity SDK can only build iOS projects from a Mac - you cannot build your Xcode project on Windows.
  • All DT SDKs and supported mediated networks work in conjunction with Android's 64-bit architecture.

Integration Methods

Digital Turbine  supports two methods for the integration of Unity:

  1. Integration through Unity's Package Manager
  2. Importing FairBid Unity Plugin Raw Package

Integrating Through Unity's Package Manager

Note

This is the recommended method to integrate the DT FairBid SDK 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:

  1. Add the following entries inside your manifest.json file, which you can find under the Packages folder:
  • Add an entry under scopedRegistries, so that unity knows where to search when adding the DT FairBid Unity Plugin dependency. This entry points to the NPM package registry:
{
    …
    "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:
{
    …
    "dependencies": {
        "com.fyber.fairbid.unity": "3.31.0",
        …
    }
    …
  }
  
  1. Save the changes and open your Unity 3D Project.

The Unity Package Manager resolves the dependencies and now the DT FairBid Unity package should be integrated in the project.

Additionally, to cross-check the integration of DT FairBid:

  1. Go to the “Window” toolbar menu of Unity 3D
  2. Click Package Manager

You should see the following window pop-up with DT FairBid under the section DT and the DT FairBid SDK version:

You also have the possibility to change the version of the DT FairBid Unity Plugin that you are integrating through the Unity Package Manager.

Important

The integrated DT FairBid Unity Plugin is a lightweight dependency. You must add the sources of the native DT FairBid SDKs for the platform you are building. Follow the instructions for the platform specific set-ups below.

Importing DT FairBid Unity Plugin Raw Package

Follow the instructions below to manually download the DT FairBid Unity Package.

Manual Download

 

Removing Current Plugin

If you are updating the Plugin:

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

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

   

If your current DT FairBid Plugin pre-dates version 3.4.1 refer to Migrating from the Old to New Structure below to ensure it is correctly removed.

Importing New Plugin

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

Important

The integrated DT FairBid Unity Plugin is a lightweight dependency. You must add the sources of the native DT FairBid SDKs for the platform you are building. Follow the instructions for the platform specific setups below.

OS Specific Setup

iOS Specific Setup

The DT FairBid iOS SDK dependency must be added to your project.

You must Build and run your Unity 3D project and then add the DT FairBid iOS SDK pod in your Podfile.

Recent versions of Unity 3D (since 2019.3) create a target named UnityFramework. If this is your case and you can see this target inside your Podfile, then add the DT FairBid iOS SDK dependency under it. Otherwise, add it to the standard target. Then run the pod install command, in exactly the same way you would for a native integration:

  target 'UnityFramework' do
  
    # Pods for UnityFramework
    pod 'FairBidSDK', '~> 3.31.0'
    
  end
  

Back to Top ⇧