---
title: Mediation
description: Configure AdMob mediation adapters for React Native Google Mobile Ads.
---
> ## Documentation Index
> Fetch the complete documentation index at: https://react-native-google-mobile-ads.dev/llms.txt
> Use this file to discover all available pages before exploring further.

Mediation asks more than one ad network for an ad, including AdMob, and serves the one that wins. Use it when you want a higher chance of a filled request. This page is how you add the adapters for this library.

## Configure mediation in the AdMob UI

To configure mediation in the AdMob UI, complete the following steps:

1. Choose an ad source from the network details table ([Android](https://developers.google.com/admob/android/choose-networks#network_details) | [iOS](https://developers.google.com/admob/ios/choose-networks#network_details)).
2. Follow steps 1-2 of that ad source's integration guide.

## Install mediation adapters

For the Google Mobile Ads SDK to communicate with third-party ad networks, you need to include a mediation adapter for each network in your app. Each
adapter must be integrated in the Android and iOS layer of your application.

Some third-party networks also ship as scoped npm packages under
`@react-native-google-mobile-ads/<network>` (optional; install only what you mediate).
See [Migrating to v17](/migration/v17#optional-scoped-mediation-adapter-packages).

To choose the adapters you want to install, see Integrate open source and versioned adapters
([Android](https://developers.google.com/admob/android/choose-networks#integrate_open-source_and_versioned_adapters) | [iOS](https://developers.google.com/admob/ios/choose-networks#integrate_open-source_and_versioned_adapters)).

Some adapters constrain the compatible Google Mobile Ads SDK version. The adapter
packages do not change that SDK pin. If you must override the package's supported default,
follow [Native SDK version overrides](/migration/v17#native-sdk-version-overrides)
and test the app-owned combination.

Tip pins for each scoped adapter live in that package's
`packages/<network>/package.json` under `sdkVersions`
(`android.googleMobileAdsMediation` / `ios.googleMobileAdsMediation`). Prefer those pins
(or the scoped npm package) over hard-coding older Expo `expo-build-properties` versions.

Yandex (`@react-native-google-mobile-ads/yandex`) is iOS-only. Its CocoaPods pin
(`YandexMobileAdsAdMobAdapters` in `packages/yandex/package.json` `sdkVersions`) still
requires `Google-Mobile-Ads-SDK ~> 13.8.0`, which does **not** admit core's iOS tip pin
(`13.10.0`). See the [yandex adapter package documentation](https://github.com/invertase/react-native-google-mobile-ads/tree/main/packages/yandex)
for the conflict and options before enabling that network.

### Android Next-Gen and mediation hosts

When the Android build selects [GMA Next-Gen](/next-gen-sdk), the scoped adapter
packages exclude transitive classic `play-services-ads` / `play-services-ads-lite`
so only Next-Gen is on the classpath. AdMob-hosted mediation is supported. For a
third-party mediation platform, check its compatibility before selecting Next-Gen; see
[Mediation and Google Ad Manager](/next-gen-sdk#mediation-and-google-ad-manager).

<Tabs groupId="framework" values={[{label: 'React Native', value: 'bare'}, {label: 'Expo', value: 'expo'}]}>
<TabItem value="bare">

Android

- Add the adapter's dependency to your app-level `android/app/build.gradle` file.

iOS

- Add the adapter's pod to your `ios/Podfile`.

</TabItem>
<TabItem value="expo">

Add native dependencies using the [`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties) plugin.

Install the plugin if you haven't already:

```bash
npx expo install expo-build-properties
```

Add the plugin to your `app.json` or `app.config.js` file, specifying the Android dependency or iOS pod for the adapter.

```json
// app.json
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "dependencies": [
              // Example: Add the AppLovin mediation adapter for Android. Replace {X.Y.Z.A} with the specific adapter version you are integrating.
              "com.google.ads.mediation:applovin:{X.Y.Z.A}"
            ]
          },
          "ios": {
            "pods": [
              {
                // Example: Add the AppLovin mediation adapter for iOS.
                "name": "GoogleMobileAdsMediationAppLovin"
              }
            ]
          }
        }
      ]
    ]
  }
}
```

Rebuild your development client to include the new native dependencies:

```bash
npx expo prebuild --clean
npx expo run:android
npx expo run:ios
```

</TabItem>
</Tabs>

## Verify your setup with ad inspector

To open the ad inspector from your React Native application, see [Ad inspector](/ad-inspector).

## Meta Audience Network (Facebook)

Install the scoped adapter package (`@react-native-google-mobile-ads/facebook`) rather than pinning
`GoogleMobileAdsMediationFacebook` alone via `expo-build-properties`. The package pins the Google
mediation adapter (and thus `FBAudienceNetwork`) and exposes Meta privacy hooks.

Call those hooks **before** `mobileAds().initialize()` when they apply:

```ts
import mobileAds from 'react-native-google-mobile-ads';
import {
  setAdvertiserTrackingEnabled,
  setDataProcessingOptions,
} from '@react-native-google-mobile-ads/facebook';

// After App Tracking Transparency resolves (when you use ATT on iOS versions that still need it):
setAdvertiserTrackingEnabled(trackingGranted);
// Optional Limited Data Use:
// setDataProcessingOptions(['LDU']);

await mobileAds().initialize();
```

| Platform | Advertiser tracking                                                                                                                                                                                                                                                                                                                           | Data-processing options                 |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| iOS      | Calls `FBAdSettings.setAdvertiserTrackingEnabled`. On **iOS 17+** with Audience Network **6.15.0+**, Meta’s own header marks that setter deprecated and unused — the SDK reads `ATTrackingManager.trackingAuthorizationStatus` instead. Still call it on older iOS, or keep it for a single code path; it does not fix a process-start crash. | `FBAdSettings.setDataProcessingOptions` |
| Android  | No-op — Meta’s Android `AdSettings` has no advertiser-tracking setter                                                                                                                                                                                                                                                                         | `AdSettings.setDataProcessingOptions`   |

Do **not** put `metaAdvertiserTrackingEnabled` / `metaDataProcessingOptions` / `metaAudienceNetworkEnabled` on the core Expo plugin — those keys are not recognized. The core and `@react-native-google-mobile-ads/facebook` Expo plugins warn on unknown options. The facebook adapter plugin only merges `skAdNetworkItems`; advertiser tracking remains a runtime JS call because ATT status is not knowable at prebuild time.

### iOS process-start crash when the Meta adapter is linked

Linking `GoogleMobileAdsMediationFacebook` pulls in Meta’s `FBAudienceNetwork` framework. That SDK can
abort during its own early `dispatch_once` work on the main queue — **before any ad request and before
JavaScript runs**. A reported signature is `SIGABRT` with an unrecognized selector involving a format
string `%s` on `NSString`. That path is inside Meta’s binary, not in `react-native-google-mobile-ads`
native modules (the JS `setAdvertiserTrackingEnabled` bridge cannot run early enough to prevent it).

If AppLovin / Unity mediation start fine and only Meta fails at launch:

1. Confirm the **AdMob / GAM** iOS App ID is in Info.plist (`GADApplicationIdentifier` via the core Expo
   plugin). A missing AdMob App ID also crashes at start; that is unrelated to Meta and is already
   covered in [Google AdMob](/configuration).
2. Set `NSUserTrackingUsageDescription` (core plugin `userTrackingUsageDescription`) when you use ATT.
3. Prefer the scoped package tip pin in `packages/facebook/package.json` `sdkVersions`
   over an older Expo `expo-build-properties` pod pin.
4. Retest on a **non-beta** iOS release. Beta OS builds have shown the same Meta launch abort with older
   adapter pins (for example mediation **6.17.1.0** on iOS 26 beta).

This library cannot patch Meta’s closed-source `dispatch_once` path. Escalate persistent launch aborts
to Meta Audience Network / Google’s Meta mediation adapter with a full crash report.

See the [facebook adapter package documentation](https://github.com/invertase/react-native-google-mobile-ads/tree/main/packages/facebook) for class names and pins.

## Pangle (ByteDance)

Prefer the scoped mediation package (`@react-native-google-mobile-ads/pangle`) so Pangle participates in AdMob / GAM mediation through Google’s adapter. That package links `GoogleMobileAdsMediationPangle` / `com.google.ads.mediation:pangle` (tip pins in `packages/pangle/package.json` `sdkVersions`) and does **not** add JS load/show APIs — use core `initialize()`, fullscreen / native / banner surfaces, and adapter status as usual.

### Lifecycle: `destroy()` already exists

Fullscreen (`InterstitialAd`, `RewardedAd`, `RewardedInterstitialAd`, `AppOpenAd`), native ads, multi-format handles, and preload pools expose idempotent `destroy()` (and hooks that own inventory call it for you). See [Migrating to v17 — lifecycle](/migration/v17#additive-lifecycle--destroy-ownership-impression). Call `destroy()` when you finish with an ad (or let hook / pool ownership rules do it). There is no separate destroy API for Pangle in this library: mediation adapters are not owned as separate JS ad objects.

### iOS Auto Layout conflicts when hosting Google and Pangle video together

Reports of iOS `Unable to simultaneously satisfy constraints` on a `UIButton` with two different trailing constants against a `UIImageView` (for example `-(5)-|` and `-(36)-|`), often while loading Google and Pangle video creatives in the same process, originate inside **third-party creative / SDK view hierarchies** — not in this package’s React Native banner or fullscreen bridges (those do not build that `UIButton`/`UIImageView` constraint pair).

UIKit typically recovers by breaking one constraint; treat a symbolic `UIViewAlertForUnsatisfiableConstraints` breakpoint or console noise as an upstream layout warning unless you have a native crash stack that points at `RNGoogleMobileAds*` code.

If you also link the Pangle host SDK **directly** (for example CocoaPods `Ads-Global` plus a custom Pangle TurboModule) **alongside** `react-native-google-mobile-ads`, you are dual-hosting two video ad stacks. Prefer mediation via `@react-native-google-mobile-ads/pangle` instead of a second direct Pangle integration, keep core `destroy()` hygiene, and escalate persistent creative Auto Layout failures to Pangle / Google’s Pangle mediation adapter with a full Instruments / constraint dump.

See the [pangle adapter package documentation](https://github.com/invertase/react-native-google-mobile-ads/tree/main/packages/pangle) for class names and pins.

## Call Android / iOS code from React Native

A third-party mediation adapter might have specific Android or iOS APIs that aren't exposed to your React Native code. In these cases, you can create a custom "bridge" to expose that native functionality.

<Tabs groupId="framework" values={[{label: 'React Native', value: 'bare'}, {label: 'Expo', value: 'expo'}]}>
<TabItem value="bare">

This involves writing native code in both the Android and iOS layer.

**Android**

Create a `Module` class to contain your native logic and a `Package` class to register that module with your application.

1. Create the native module. This class contains the methods you want to call from JavaScript.

Example file: `android/app/src/main/java/com/your-app-name/`

The following example creates a **Module** class to use with the Google Mobile Ads mediation adapter for AppLovin:

```
package com.your-app-name

import android.util.Log
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
// Import the necessary third-party SDKs.
import com.applovin.sdk.AppLovinPrivacySettings

class GoogleMobileAdsMediationAppLovinModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {

  // The React layer interfaces with the value of this API.
  override fun getName() = "GoogleMobileAdsMediationAppLovin"

  // This exposes the method to the React layer.
  @ReactMethod
  fun setHasUserConsent(hasUserConsent: Boolean) {
    AppLovinPrivacySettings.setHasUserConsent(hasUserConsent)
  }
}
```

2. Create the package

   This class registers your module so React Native can find it.

Example file: `android/app/src/main/java/com/your-app-name/`

```
package com.your-app-name

import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
import java.util.Collections

class GoogleMobileAdsMediationAppLovinPackage : ReactPackage {
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
    return listOf(GoogleMobileAdsMediationAppLovinModule(reactContext))
  }

  override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
    return Collections.emptyList()
  }
}
```

3. Register the package

Add your new package in your `MainApplication` file:

```
override fun getPackages(): List<ReactPackage> =
  PackageList(this).packages.apply {
    // Add your custom package here.
    add(GoogleMobileAdsMediationAppLovinPackage())
}
```

**iOS**

Create a header (`.h`) and an implementation (`.m`) file. The following example creates an `GoogleMobileAdsMediationAppLovin` class:

Example file: `ios/GoogleMobileAdsMediationAppLovin.h`

```
#import <React/RCTBridgeModule.h>

@interface GoogleMobileAdsMediationAppLovin : NSObject <RCTBridgeModule>
@end
```

Example file: `ios/GoogleMobileAdsMediationAppLovin.m`

```
#import "GoogleMobileAdsMediationAppLovin.h"
#import <Foundation/Foundation.h>
// Import the necessary third-party SDKs.
#import <AppLovinSDK/AppLovinSDK.h>

@implementation GoogleMobileAdsMediationAppLovin

// The React layer interfaces with the class name, e.g. GoogleMobileAdsMediationAppLovin, by default.
RCT_EXPORT_MODULE();

// This exports the method to the React layer.
RCT_EXPORT_METHOD(setHasUserConsent:(BOOL)hasUserConsent)
{
  [ALPrivacySettings setHasUserConsent:hasUserConsent];
}

@end
```

**Import native modules**

In the JavaScript file where you want to call the native method, import `NativeModules` from the `react-native` library:

```
import { NativeModules } from 'react-native'
```

You can then access your module directly from the `NativeModules` object. The name you use here must exactly match the name
exposed by your native code.

The following example uses the `GoogleMobileAdsMediationAppLovin` sample class:

```
const { GoogleMobileAdsMediationAppLovin } = NativeModules
```

Once you have the module object, you can work with your object just as you would in JavaScript.

```
GoogleMobileAdsMediationAppLovin.setHasUserConsent(true)
```

</TabItem>
<TabItem value="expo">

1. **Create an [Expo module](https://docs.expo.dev/modules/get-started/)** with the `create-expo-module` tool.

Run the following command from your project's root directory:

```
npx create-expo-module --local
```

When prompted, give your module a name. This will scaffold a new module in a modules/ directory at your project root.

2. **Add your native Android and iOS code**. The following example creates a module to use with the
   Google Mobile Ads mediation adapter for AppLovin:

Android

Open the generated Kotlin file for your module and add your custom method. The module and package are already set up for you.

File: `modules/google-mobile-ads-mediation-applovin/android/src/main/java/.../GoogleMobileAdsMediationApplovinModule.kt`

```
// ... existing imports
import com.applovin.sdk.AppLovinPrivacySettings

class GoogleMobileAdsMediationApplovinModule : Module() {
  override fun definition() = ModuleDefinition {
    // ... existing definition

    // Add your custom method here.
    Function("setHasUserConsent") { hasUserConsent: Boolean ->
      AppLovinPrivacySettings.setHasUserConsent(hasUserConsent)
    }
  }
}
```

Then, add the dependency in your module's `build.gradle` file.

File: `modules/google-mobile-ads-mediation-applovin/android/build.gradle`

```
// Groovy

dependencies {
  // Add the third-party SDK dependency. Replace {X.Y.Z.A} with the specific adapter version you are integrating.
  implementation 'com.google.ads.mediation:applovin:{X.Y.Z.A}'
}
```

iOS

Open the generated Swift file for your module and add your custom method.

File: `modules/google-mobile-ads-mediation-applovin/ios/GoogleMobileAdsMediationApplovinModule.swift`

```
// ... existing imports
import AppLovinSDK

public class GoogleMobileAdsMediationApplovinModule: Module {
  public func definition() -> ModuleDefinition {
    // ... existing definition

    // Add your custom method here
    Function("setHasUserConsent") { (hasUserConsent: Bool) in
      ALPrivacySettings.setHasUserConsent(hasUserConsent)
    }
  }
}
```

Next, add the dependency in your module's `.podspec` file.

File: `modules/google-mobile-ads-mediation-applovin/google-mobile-ads-mediation-applovin.podspec`

```
# Add the third-party pod dependency.
s.dependency 'GoogleMobileAdsMediationAppLovin'
```

3. **Install and rebuild**. After creating the module and adding the code, install it in your project and rebuild your development client.

4. **Call the code from JavaScript**. You can now import and use the module directly in your code.

```
import { setHasUserConsent } from 'google-mobile-ads-mediation-applovin'

// Call your custom native method.
setHasUserConsent(true)
```

</TabItem>
</Tabs>
