<br />

This guide shows you how to use Google Mobile Ads Flutter Plugin to load and display
ads from InMobi using
[mediation](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/mediation.md.txt), covering both waterfall and bidding
integrations. It covers how to add
InMobi to an ad unit's
mediation configuration, and how to integrate the
InMobi SDK and adapter into a
Flutter app.

## Supported integrations and ad formats

| Integration ||
|---|---|
| Bidding | Yes |
| Waterfall | Yes |
| App Open |   |
| Banner | Yes |
| Interstitial | Yes |
| Rewarded | Yes |
| Rewarded Interstitial | Yes |
| Native | Yes |

## Prerequisites

Before you continue, verify the following:

- Latest Google Mobile Ads Flutter Plugin version.
- Flutter framework version 3.7.0 or later.
- To deploy on Android
  - Android API level 24 or later.
- To deploy on iOS
  - iOS deployment target of 10.0 or later.
- A working Flutter project configured with Google Mobile Ads Flutter Plugin. See [Set up Google Mobile Ads Flutter Plugin](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/quick-start.md.txt) for details.

- [Set up mediation](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/mediation.md.txt).

## Step 1: Set up configurations in InMobi UI

- [Sign up](https://publisher.inmobi.com/signup) for an InMobi account.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/create_account.png)
- Once your account is verified, [log in](https://publisher.inmobi.com).

### Add an app

- To add your app to the InMobi dashboard, click **Inventory \> Inventory
  Settings**.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/inventory.png)
- Click **Add Inventory** and select the **Mobile App** channel from the drop-down menu.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/Inventory_settings.png)
- Start typing your published app store **URL** in the search bar and select the app from the auto-populated results. Click **Continue**.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/Start_monetizing.png)
- If your app in not published, click **Link manually** and enter the required details. Click **Continue**.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/Manual_enter_app.png)
- Review the **App \& Website Compliance** settings and then click **Save and
  Create Placements**.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/Review_compliance.png)

### Placements

- After you set up your inventory, the system redirects you to the placement creation workflow.

> [!NOTE]
> **Note:** If the system does not redirect you to the placement creation workflow, go to **Inventory \> Inventory Settings** . Then, search for the app or website you would like to create a placement for. Click **Add a placement**.

- ![](https://developers.google.com/static/admob/images/mediation/inmobi/Inventory_Setting_Placement.png)

### Bidding

> [!NOTE]
> **Note:** Contact your account manager to get access for configuring bidding in the InMobi dashboard.

Select the type of ad unit. Then enter a **Placement Name** , select
**On** and **Google SDK Bidding** for **Audience Bidding** and **Partner**
respectively, and fill out the rest of the form. Click **Create Placement**
when done.

![](https://developers.google.com/static/admob/images/mediation/inmobi/placement_bidding.png)

### Waterfall

Select the type of ad unit. Then enter a **Placement Name** , select
**Off** for **Audience Bidding** , and fill out the rest of the form. Click
**Create Placement** when done.

![](https://developers.google.com/static/admob/images/mediation/inmobi/placement_waterfall.png)
- Once the placement is created, its details are shown. Take note of the Placement ID, which will be used for setting up your Ad Manager ad unit.

> [!NOTE]
> **Note:** The InMobi Placement ID is present under the placement name.

- ![](https://developers.google.com/static/admob/images/mediation/inmobi/placement_id_interstitial.png)

### Account ID

- Your InMobi account ID is available under **Finance \> Payment Settings \>
  Payment Information**.
- ![](https://developers.google.com/static/admob/images/mediation/inmobi/account_id.png)

### Locate InMobi Reporting API Key

### Bidding

This step isn't required for bidding integrations.

### Waterfall

Go to **My Account \> Account Settings** . Navigate to the **API Key** tab
and click **Generate API Key**.

Select the **email** of the user the key is required for and click
**Generate API Key**. A file containing the API key and username/login name
will be generated.

![](https://developers.google.com/static/admob/images/mediation/inmobi/API_key_generation.png)

Only the publisher administrator of the account will be able to generate an
API key for all users. If you have forgotten the previously generated API
key, reset your API key by hovering over your mail on the **API Key** tab.

![](https://developers.google.com/static/admob/images/mediation/inmobi/Reset_secret_key.png)

### Update your app-ads.txt

- [Authorized Sellers for Apps app-ads.txt](https://iabtechlab.com/wp-content/uploads/2019/03/app-ads.txt-v1.0-final-.pdf) is an IAB Tech Lab initiative that helps ensure your app ad inventory is only sold through channels you've identified as authorized. To prevent a significant loss in ad revenue, you'll need to implement an `app-ads.txt` file. If you haven't done so already, [create an app-ads.txt file for Ad Manager](https://support.google.com/admanager/answer/7544382).
- To implement `app-ads.txt` for InMobi, [Add your personalized code snippet](https://support.inmobi.com/monetize/manage-inventory/app-ads-txt/set-up-an-app-ads.txt-file-for-your-app#add-your-personalized-code-snippet).

### Turn on test mode

- Enable **Test Mode** for your placement on all live impressions or certain test devices only.

> [!NOTE]
> **Note:** Test mode is turned **Off** by default for all placements. However, test mode can be enabled for placements across all app instances or only for devices you specify.

- ![](https://developers.google.com/static/admob/images/mediation/inmobi/test_ios_android.png)

## Step 2: Set up InMobi demand in Ad Manager UI

### Configure mediation settings for your ad unit

### Android

For instructions, see step 2 in the guide for

[Android](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/inmobi.md.txt#step-2).

### iOS

For instructions, see step 2 in the guide for

[iOS](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/mediation/inmobi.md.txt#step-2).

### Add InMobi to GDPR and US state regulations ad partners list

- Follow the steps in [European regulations settings](https://support.google.com/admanager/answer/10113006#adding_ad_partners_to_published_gdpr_messages) and [US state regulations settings](https://support.google.com/admanager/answer/14117973) to add **InMobi** to the European and US state regulations ad partners list in the Ad Manager UI.

## Step 3: Import the InMobi SDK and adapter

> [!NOTE]
> **Note:** Failure to integrate the compatible InMobi and Google Mobile Ads Flutter Plugin versions might lead to build issues.

### Integration through pub.dev

- Add the following dependency with the latest versions of the InMobi SDK and adapter in your package's `pubspec.yaml` file:

```yaml
dependencies:
  gma_mediation_inmobi: ^2.4.0
```

### Manual Integration

- Download the latest version of Google Mobile Ads mediation plugin for [InMobi](https://pub.dev/packages/gma_mediation_inmobi/versions), extract the downloaded file, and add the extracted plugin folder (and its contents) to your Flutter project. Then, reference the plugin in your `pubspec.yaml` file by adding the following dependency:

```yaml
dependencies:
  gma_mediation_inmobi:
    path: path/to/local/package
```

## Step 4: Implement privacy settings on InMobi SDK

### EU consent and GDPR

- To [comply with
  the Google EU User Consent Policy](https://www.google.com/about/company/consentstaging.html), you must make certain disclosures to your users in the European Economic Area (EEA), the UK, and Switzerland, and obtain their consent for the use of cookies or other local storage where legally required, and for the collection, sharing, and use of personal data for ads personalization. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). You are responsible for verifying that consent is propagated to each ad source in your mediation chain.
- InMobi Flutter adapter version 1.1.0 and later supports passing GDPR consent signals from consent management platforms that integrate with IAB's Transparency and Consent Framework (TCF) to InMobi SDK. For more information, see [GDPR](https://support.inmobi.com/monetize/privacy/gdpr).

### US states privacy laws

- [US states privacy laws](https://support.google.com/admanager/answer/9561023) require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered through a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The [US states privacy
  laws compliance guide](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/privacy/us-states) offers the ability to enable [restricted data processing](https://privacy.google.com/businesses/rdp/) for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance.
- The Google Mobile Ads mediation plugin for InMobi does not support passing consent information to the InMobi SDK.

## Step 5: Add required additional code

### Android

No additional code is required for
InMobi integration.

### iOS

### SKAdNetwork integration

Follow [InMobi's
documentation](https://support.inmobi.com/monetize/ios-guidelines/preparing-for-ios-14)
to add the SKAdNetwork identifiers to your project's `Info.plist` file.

## Step 6: Test your implementation

### Enable test ads

- Make sure you [register your test device](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/test-ads.md.txt#enable_test_devices) for Ad Manager and [enable test mode](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/mediation/inmobi.md.txt#turn-on-test-mode) in InMobi UI.

> [!IMPORTANT]
> **Important:** Disable test mode for Ad Manager and InMobi before releasing your app.

### Verify test ads

- To verify that you are receiving test ads from InMobi, enable [single ad source testing](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/ad-inspector.md.txt#single_ad_source_testing) in ad inspector using the **InMobi (Bidding) and InMobi (Waterfall)** ad source(s).

## Optional steps

### Android

#### Permissions

For optimal performance,
InMobi recommends adding the
following optional
permissions to your app's `AndroidManifest.xml` file.

```java
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
```

<br />

### iOS

No additional steps required for iOS integration.

## Error codes

- If the adapter fails to receive an ad from InMobi, publishers can check the underlying error from the ad response using [`ResponseInfo`](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/response-info.md.txt) under the following classes:

### Android

```java
com.google.ads.mediation.inmobi.InMobiAdapter
com.google.ads.mediation.inmobi.InMobiMediationAdapter
```

### iOS

```objective-c
GADMAdapterInMobi
GADMediationAdapterInMobi
```
- Here are the codes and accompanying messages thrown by the InMobi adapter when an ad fails to load:

### Android

| Error code | Reason |
|---|---|
| 0-99 | InMobi SDK Errors. See [code](https://github.com/googleads/googleads-mobile-android-mediation/blob/7e6fcc20ace3c0ad37722487a0b33570ee0677d2/ThirdPartyAdapters/inmobi/inmobi/src/main/java/com/google/ads/mediation/inmobi/InMobiAdapterUtils.java#L254-L298) for more details. |
| 100 | InMobi server parameters configured in the Ad Manager UI are missing/invalid. |
| 101 | Failed to initialize the InMobi SDK. |
| 102 | The requested ad size does not match an InMobi supported banner size. |
| 103 | Ad request is not a unified native ad request. |
| 104 | Attempted to request an InMobi ad without initializing the InMobi SDK. This should in theory never happen since the adapter initializes the InMobi SDK prior to requesting InMobi ads. |
| 105 | InMobi's ad is not yet ready to be shown. |
| 106 | InMobi failed to display an ad. |
| 107 | InMobi returned a native ad that is missing a required asset. |
| 108 | InMobi's native ad image assets contain a malformed URL. |
| 109 | The adapter failed to download InMobi's native ad image assets. |

### iOS

| Error code | Reason |
|---|---|
| 101 | InMobi server parameters configured in the Ad Manager UI are missing/invalid. |
| 102 | The requested ad size does not match an InMobi supported banner size. |
| 103 | An InMobi ad is already loaded for this network configuration. |
| 104 | InMobi native ad returned with missing native assets, or required image assets failed to download. |
| 105 | An InMobi ad is not ready to be shown. |
| 106 | An empty or nil bid token is returned by InMobi. |
| Other | InMobi SDK returned an error. See `IMRequestStatus.h` for more details. |

## InMobi Flutter Mediation Adapter Changelog

#### Version 2.4.1 (In progress)

#### Version 2.4.0

  - Supports [inMobi Android adapter version 11.5.0.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11501).
  - Supports [inMobi iOS adapter version 11.5.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11500).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 9.1.0.

#### Version 2.3.3

  - Supports [inMobi Android adapter version 11.4.1.2](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11412).
  - Supports [inMobi iOS adapter version 11.4.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11410).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 9.1.0.

#### Version 2.3.2

  - Supports [inMobi Android adapter version 11.4.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11411).
  - Supports [inMobi iOS adapter version 11.4.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11410).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 9.1.0.

#### Version 2.3.1

  - Updated to support Google Mobile Ads Flutter Plugin version 9.1.0.
  - Added Swift Package Manager support.
  - Supports [inMobi Android adapter version 11.4.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11410).
  - Supports [inMobi iOS adapter version 11.4.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11410).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 9.1.0.

#### Version 2.3.0

  - Updated to support Google Mobile Ads Flutter Plugin version 9.0.0.
  - Supports [inMobi Android adapter version 11.4.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11400).
  - Supports [inMobi iOS adapter version 11.4.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11400).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 9.0.0.

#### Version 2.2.0

  - Supports [inMobi Android adapter version 11.3.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11300).
  - Supports [inMobi iOS adapter version 11.3.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11300).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 8.0.0.

#### Version 2.1.0

  - Updated minimum Flutter version to 3.38.1.
  - Updated to support Google Mobile Ads Flutter Plugin version 8.0.0.
  - Supports [inMobi Android adapter version 11.2.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11200).
  - Supports [inMobi iOS adapter version 11.2.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11200).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 8.0.0.

#### Version 2.0.1

  - Updated minimum Flutter version to 3.35.1
  - Updated to support Google Mobile Ads Flutter Plugin version 7.0.0
  <!-- -->

  - Supports [inMobi Android adapter version 11.1.0.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11101).
  - Supports [inMobi iOS adapter version 11.1.0.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11101).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 7.0.0.

#### Version 2.0.0

  - Supports [inMobi Android adapter version 11.1.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-11100).
  - Supports [inMobi iOS adapter version 11.1.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-11100).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.6

  - Supports [inMobi Android adapter version 10.8.8.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10881).
  - Supports [inMobi iOS adapter version 10.8.8.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10880).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.5

  - Supports [inMobi Android adapter version 10.8.8.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10880).
  - Supports [inMobi iOS adapter version 10.8.8.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10880).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.4

  - Supports [inMobi Android adapter version 10.8.7.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10870).
  - Supports [inMobi iOS adapter version 10.8.6.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10860).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.3

  - Supports [inMobi Android adapter version 10.8.3.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10831).
  - Supports [inMobi iOS adapter version 10.8.3.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10831).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.2

  - Supports [inMobi Android adapter version 10.8.3.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10831).
  - Supports [inMobi iOS adapter version 10.8.3.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10830).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.1

  - Supports [inMobi Android adapter version 10.8.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10820).
  - Supports [inMobi iOS adapter version 10.8.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10820).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 6.0.0.

#### Version 1.1.0

  - iOS plugin is now a static framework.
  - Supports [inMobi Android adapter version 10.8.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10800).
  - Supports [inMobi iOS adapter version 10.8.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10800).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 5.3.1.

#### Version 1.0.0

  - Initial release.
  - Supports [inMobi Android adapter version 10.6.7.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/inmobi/CHANGELOG.md#version-10671).
  - Supports [inMobi iOS adapter version 10.7.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/InMobi/CHANGELOG.md#version-10720).
  - Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0.