Skip to main content

Overview

The Adrop React Native SDK allows you to easily integrate various ad formats into your React Native app.

Supported Ad Formats


Requirements

React Native

  • React Native 0.71 or higher

Android

  • API level 23 (Android 6.0) or higher
  • compileSdkVersion 34
  • Kotlin 2.1.0 or higher
  • Gradle 8.7 or higher

iOS

  • iOS 13.0 or higher
  • Swift 5.0 or higher

Installation

1. Install Package

2. Android Setup

Add the backfill ad repository to android/settings.gradle.kts.
android/settings.gradle.kts
Add the Kotlin plugin and backfill dependency to android/app/build.gradle.
android/app/build.gradle
Add the backfill App ID to android/app/src/main/AndroidManifest.xml.
android/app/src/main/AndroidManifest.xml
Please contact Adrop to get your App ID.

3. iOS Setup

Modify ios/Podfile. Add two source lines at the top of the file, and add the backfill SDK if you use backfill ads.
ios/Podfile
  • From 1.18.0, the iOS SDK (adrop-ads, adrop-ads-backfill) is published to the adrop-specs spec repo instead of CocoaPods trunk. Adding the lines while you’re on an earlier version is harmless. Commit the updated ios/Podfile.lock after adding them.
  • Add both lines. Once a Podfile lists any source, CocoaPods stops adding trunk on its own, so other pods such as Google Mobile Ads SDK and React Native dependencies can’t be installed.
  • If your Podfile already has source 'https://github.com/CocoaPods/Specs.git', add only the first line.
Install pods.
When you upgrade from 1.17.x or earlier to 1.18.0 or later, run the following command instead of pod install. Leave out adrop-ads-backfill if you don’t use backfill ads. Commit the updated ios/Podfile.lock too.
Backfill SDK 1.18.0 and later uses Google Mobile Ads SDK 13. If you also use react-native-google-mobile-ads, you need version 16.1.0 or later. Versions 16.0.x and earlier use Google Mobile Ads SDK 12, so pod installation fails. If you can’t update the library, keep adrop-ads-react-native and the backfill SDK on 1.17.x ("adrop-ads-react-native": "~1.17.0" in package.json and pod 'adrop-ads-backfill', '~> 1.17.0' in the Podfile).

4. Info.plist Configuration

Add the following settings to ios/YourApp/Info.plist for backfill ads.
  • GADApplicationIdentifier: App ID for backfill ads
  • SKAdNetworkItems: Required for ad conversion tracking on iOS 14+
Info.plist
If your Info.plist already contains a SKAdNetworkItems key, do not add a new one — merge only the array (<array>) entries. Duplicate keys cause iOS to use only the first array.
Please contact Adrop for the full SKAdNetworkItems list and App ID.

Initialization

Initialize the SDK when your app starts. This is typically done in App.tsx or index.js.
App.tsx

Initialization Options

Parameters Example

Theme Settings

Set the UI theme for ads.

User Identifier Settings

Set the user identifier (UID) for targeted advertising.
UID is transmitted after being hashed with SHA-256. Do not directly pass personal information such as email or phone number.

Test Unit IDs

Use the following test unit IDs during development and testing.
Be sure to replace with actual unit IDs before production deployment.

Error Codes

Error codes that may occur in the SDK.

Troubleshooting

iOS Build Error

If you encounter Swift version compatibility issues, add the following to the post_install block in ios/Podfile.
ios/Podfile

Pod Installation Errors (Upgrading to 1.18.0)

  • None of your spec sources contain a spec satisfying the dependency: Check that the two source lines are at the top of ios/Podfile. If they’re already there, run cd ios && pod update adrop-ads adrop-ads-backfill (or pod update adrop-ads if you don’t use backfill ads). For Expo, check that the config plugin has the withAdropPodSources step, then run npx expo prebuild --clean.
  • required a higher minimum deployment target: This isn’t a deployment target problem. If Podfile.lock still has an earlier version, run cd ios && pod update adrop-ads (add adrop-ads-backfill if you use backfill ads). If the error mentions Google-Mobile-Ads-SDK, another library uses Google Mobile Ads SDK 12. See the Google Mobile Ads SDK note in iOS Setup above.

Android Build Error

If the Kotlin version doesn’t match, check the Kotlin version in android/build.gradle.
android/build.gradle

Next Steps

Banner Ads

Implement banner ads

Native Ads

Implement native ads

Interstitial Ads

Implement interstitial ads

Rewarded Ads

Implement rewarded ads

WebView Guide

Display web ads in WebView

UMP Integration

GDPR/CCPA consent management

Popup Ads

Implement popup ads

Splash Ads

Configure splash ads

Targeting

Set up audience targeting

Reference

Complete API reference

Examples

Full implementation examples