Integrating the Android SDK

Before Starting

Starting from version 8.0.0 of the Marketplace SDK a single library only is required and and it is no longer necessary to choose any modules, as everything is packed together.

For versions older than 8.0.0, Integrating the Android SDK begins once you decide which of the modules you want to integrate.

You can choose from the following:

  • ia-sdk-core (Required for all)
  • ia-mraid-kit (HTML/MRAID content)
  • ia-video-kit (Rendering/Video content)


We recommend including all the libraries and configuring the content at the placement level.

Step 1: Integrating the SDK in your App

Fyber supports both Maven Central dependencies or manual download to integrate our SDK. 
Select which option you want to use to integrate the SDK:

Maven Central    

Add Fyber's maven repository and dependencies to your gradle build script:

  1. Add the following to your app’s project level build.gradle file inside the repositories section:

In project level build.gradle there are usually two repositories sections - one for buildscript and one for allprojects. Add the entry in allprojects.

allprojects {
  repositories {
    // add this
  // ...
  1. Save your file
  2. Add the following to your app’s app level build.gradle file inside the dependencies section,

Starting with version 8.0.0, include the following:

def fyberMarketplaceVersion = '8.0.0'

dependencies {
    // ...
    implementation "com.fyber:marketplace-sdk:${fyberMarketplaceVersion}"
    // ...

For versions prior to 8.0.0, include the following:

// Define the Fyber Marketplace version as a variable for easier upgrades
def fyberMarketplaceVersion = '7.8.4'

dependencies {
    // ...

    // add the relevant fyber marketplace libraries
    implementation "com.fyber.vamp:core-sdk:${fyberMarketplaceVersion}"
    implementation "com.fyber.vamp:video-kit:${fyberMarketplaceVersion}"
    implementation "com.fyber.vamp:mraid-kit:${fyberMarketplaceVersion}"
    // ...
  1. Save the file.
Manual Download

Android Download Button

  1. If you do not have an account, create one here.
  2. Copy the following files from the InneractiveAdSDK folder into your project libs folder.
    Starting with 8.0.0 -
    Starting with 8.1.0 - for Open Measurement support

    For versions prior to 8.0.0 -
  3. Add the following to your project's build.gradle file:
repositories { 
    // ...
    // Add a flat dir repository
    flatDir {
        dirs 'libs'

def fyberMarketplaceVersion = "8.0.0" // OR 7.8.4, details below

dependencies {
  // Add the fyber marketplace AAR libraries
// 8.0.0 and above -
implementation (name:"fyber-marketplace-${fyberMarketplaceVersion}", ext:'aar')
// add open measurement sdk - fyber marketplace 8.1.0 and above -
implementation (name:"omsdk-android-1.3.25-release", ext:'aar')
// prior to 8.0.0 - implementation (name:"ia-sdk-core-release-${fyberMarketplaceVersion}", ext:'aar') implementation (name:"ia-video-kit-release-${fyberMarketplaceVersion}", ext:'aar') implementation (name:"ia-mraid-kit-release-${fyberMarketplaceVersion}", ext:'aar') }

Unity Wrapper

In addition to the native Android and iOS SDKs, the Marketplace SDK supplies a unity wrapping package, which can be used to import the Marketplace SDKs into a Unity project.

The Marketplace Unity wrapper package is built upon the Google Unity jar Resolver. It works by adding the native Android/iOS dependencies to the exported native projects made at Unity run time.

To use the Unity Wrapper, download the relevant unitypackage file and import it into your project.

Unity Download Button


  • For the Maven Central URL, click here
  • Currently, the Marketplace Unity package does not provide any Unity bridging for requesting ads using Unity APIs.

Step 2: Integrating Google Play Services

We recommend using the Google Play Services, otherwise we are unable to access your Google Advertising ID. This leads to limited ad inventory, as an increasing number of advertising campaigns require the identifier. This ID is also essential for tracking daily active users (DAU) on your app.

  1. Add the following to your build.gradle dependencies section for Google Play Services:

Adding Dependencies

dependencies {
    implementation ('')
    //Use only the ads identifier library
//Implementation ('') // or implementation ('') }

For more information about Google Play Services yet, click here.

Step 3: Updating Your Android Manifest File

  1. Add the following mandatory permissions into your application's AndroidManifest.xml:

Adding Mandatory Permissions

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


ACCESS_NETWORK_STATE permission is used to differentiate Wifi from a cellular network.

  1. Add the following permissions to enable your app to get richer and broader demand

Recommended permissions for better targeting

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Step 4: Initializing the SDK

Once you have added all your Android Manifest information and are ready to start requesting ads, you must initialize the Inneractive Ads SDK :

  1. Call InneractiveAdManager.initialize(context, <"appID">), and pass on your Activity or application context:

Pass Your Activity Context 

public class MainActivity extends Activity {
   protected void onCreate(Bundle savedInstanceState) {
      InneractiveAdManager.initialize(this, "Enter_Your_Fyber_AppID"); 
   protected void onDestroy() {
      if (isFinishing()) {
           //Optionally destroy the SDK after the activity has been destroyed
InneractiveAdManager.destroy(); } } }

Optionally, when you're finished using the library and do not intend to display more ads, call InneractiveAdManager.destroy() to release any resources being used by the SDK.


If you intend to destroy the library from within your activity's onDestroy method, check to ensure that the activity has really finished.

Best Practice Check

You can change the library logging level. For more details, click here.

Locating the App ID

Follow the steps below to locate your App ID:

  1. Search for and select your app in the Console

  2. Click the three horizontal dots at the end of one of the rows
  3. Click Integration Options:

The Info window opens and your App ID and SDK information is displayed:


Initialization Callback

Starting from Marketplace SDK version 7.5.4, it is possible to add an initialization callback which notifies you about the initialization status of the SDK.

The callback can be optionally passed to the InneractiveAdManager in the following manner:

InneractiveAdManager.initialize(context, appId, new OnFyberMarketplaceInitializedListener() {
           public void onFyberMarketplaceInitialized(FyberInitStatus status) {
               // ...

Where the Status being returned in the initialized callback is:

  • SUCCESSFULLY - when the SDK has been successfully initialized.
  • FAILED_NO_KITS_DETECTED - when only the “core” Fyber Marketplace library has been detected. When this is the status, check your dependencies and add the “video-kit”, “mraid-kit” to it. 
  • FAILED - When the SDK has failed to communicate with our servers and could not be initialized at this time.
  • INVALID_APP_ID -the appId being passed to the initialize is incorrect. Please check your configuration or contact us for assistance. 

Important: Regarding the "Failed" Status

Fyber currently recommends using the SDK and performing ad requests when the FyberInitStatus is “FAILED”, as the SDK, internally, attempts to re-initialize itself when an AdRequest is executed. The above callback is not invoked in such cases.

Passing a User ID to the SDK (from v.7.7.0)

The following code snippet demonstrates how to set a User ID for this SDK session.


The initial method of the SDK must be called in advance and there is no need to wait for the onFyberMarketplaceInitialized callback

String userId = ...;
//Without reflection, using an import of the InneractiveAdManager class -

//Optionally, using reflection as an example -
Class FyberInneractiveAdManagerClass = 
Class.forName("com.fyber.inneractive.sdk.external.InneractiveAdManager"); Method setUserIdStaticMethod =
FyberInneractiveAdManagerClass.getDeclaredMethod("setUserId", String.class); setUserIdStaticMethod.invoke(null, userId);

You have completed the basic integration of the Android SDK! Now it's time to integrate other ad types.  For details of Android Ad Formats, click here.


Review the below GDPR related instructions (available starting Android v7.1.5 SDK and legacy version v6.5.6)

Locating your Spot ID

Follow the instructions below to find your Spot ID and make sure you enter the correct credentials.

  1. Go to the Inventory window
  2. Select the app for which you want to locate the ID

The Spot ID is located in brackets, next to the spot name. 

  1. Click the number to save the ID to the clipboard.

Step 5: Adding User Consent


The General Data Protection Regulation of the European Union requires you to scope your user's consent. A user could be within the GDPR scope for your app when one or all of the following apply:

  • The user is currently located in the EU
  • The user has registered with the app as an EU resident
  • The app is specifically targeted to EU users


When you set a GDPR consent value for a user, Fyber concludes that you have decided that the user is subject to GDPR rules, even if the user is outside Europe. If, based on your legal position, your non-EU users are not subject to GDPR, do not pass any consent value for them.

We recommend that you consult with a legal advisor to determine the best approach for your business. It is also highly recommended to collect user consent with a certified Consent Management Platform (CMP).

For a full list of CMPs, click here.

Once you have collected the user’s consent, you can pass it onto the SDK using the following API:

     * Set the general data protection regulation user consent status
     * @param wasConsentGiven
    public static void setGdprConsent(boolean wasConsentGiven) {…}
    // Calling the consent method

    * Set the general data protection regulation consent string
    * @param gdprConsent the consent string
    public static void setGdprConsentString(String gdprConsent) {…}

    // Calling the consent method


GdprConsent is a boolean. It is true if you have the user’s consent. If you do not have the user's consent, it is false.
GdprConsentString is a string.

If you don’t pass the user’s consent to the SDK, only contextual ads are shown to that user.

To clear the consent flag and consent data, the following API, use the following API:


It is highly recommended to use the 2nd option of passing a consent string per the IAB's Transparent & Consent Framework by using a valid CMP (Consent Management Platform). This is the most common form of consent communication worldwide and is crucial in order to enjoy ad monetization in the EU. 

We recommend that the first time you gather the user’s consent, you pass it onto the SDK after starting the SDK but before requesting an ad. The SDK then takes the user’s consent into consideration when initializing. In the following sessions, you need only call the API if the user updates their consent.


When Fyber Marketplace is being mediated by MoPub, we recommend to set the GDPR flag directly on MoPub’s consent collection manager.

This manager forwards the consent state to the Fyber Marketplace and there is no additional requirement to explicitly set the GDPR flag on the Fyber Marketplace directly.

More information on GDPR can be found under the GDPR Resource Page and FAQs.


The intention of the California Consumer Privacy Act of 2018 (CCPA) is to protect the personal information of California residents. CCPA applies to all companies doing business in California. If a California resident uses an app developer’s mobile app, CCPA applies to the developer and every company that processes the personal information of the app’s users.
CCPA came into effect on 1 January 2020.

For more information on Fyber and CCPA, refer to Fyber’s Resource Page.
For more information about CCPA, refer to the IAB CCPA Compliance Framework.

If you choose to allow users to 'opt-out of the sale of their personal information' then you may use the following:

Once you have obtained a user response to an opt-out option, you can pass it to the SDK using the following API:


/*** Setting the US privacy setting string     
* @param consentString a non empty String     
public static void setUSPrivacyString(String consentString) {…}

// Calling the consent method  		     
InneractiveAdManager.setUSPrivacyString("1YNN"); // This is an example value when the user chose NOT to 'opt-out'

To determine what value to use for the US Privacy String, refer to the IAB document here.
Example values:

  • When CCPA does not apply (for example if the user is not a resident of California) you can either skip this API or use the following value 1---
  • If the user choses NOT to opt out, and is ok with advertising as usual, you can use 1YNN
  • If the user chooses to restrict advertising and opt out, you can use 1YYN

To clear the privacy setting flag and opt-out data use the following API:

CCPA Clear Privacy Settings


Step 6: app-ads.txt

The simple app-ads.txt standard helps prevent the unauthorized selling of in-app inventory and app domain spoofing.

For details of listing your Developer Website URL in the Google Play Store, click here.

Step 7: Optional - Using the Fyber Marketplace SDK in Secure Only Mode (since version 7.2.1)

InneractiveAdManager.useSecureConnections(boolean useSecureConnnections)

This API described above allows you to control how should the SDK perform any and all network connections.

By invoking this setter with a value of true all outgoing network connections from the Fyber Marketplace SDK will be using ssl/https. The default behaviour is not to use secure connections.

Secure Demand Notice

By requesting secure only content, you potentially decrease the amount of demand which can be rendered by the SDK.


The Android application level secure API (network-security-config cleartextTrafficPermitted) takes precedence over this value - i.e. if you set cleartextTrafficPermitted to false and invoke the useSecureConnections setter with a value of false, the SDK behaves as if you requested secure only connections.

Back to Top ⇧