Skip to main content

Overview

Adrop Flutter SDK allows you to easily integrate various ad formats into your Flutter app.

Supported Ad Formats


Requirements

Flutter

  • Flutter SDK 3.3.0 or higher
  • Dart SDK 2.18.0 or higher

Android

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

iOS

  • iOS 13.0 or higher
  • Swift 5.0 or higher

Installation

1. Install Package

Run the following command in your project directory.

2. Android Setup

Add the backfill ad repository to android/settings.gradle.kts.
android/settings.gradle.kts
Add the 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.
ios/Podfile
Install pods.

4. Info.plist Configuration

Add the following settings to ios/Runner/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.

5. Add Configuration File

Android

  1. Download the adrop_service.json file from the Ad Control Console.
  2. Copy the file to the android/app/src/main/assets/ directory.

iOS

  1. Download the adrop_service.json file from the Ad Control Console.
  2. Add the file to the project root in Xcode.
  3. Make sure to add the file to all targets.

Initialization

Initialize the SDK at app startup. Typically called in main.dart.
main.dart

Initialization Options

Parameters Examples

Theme Settings

Set the ad UI theme.

Set User Identifier

Set a user identifier (UID) for targeted advertising.
UID is hashed with SHA-256 before transmission. Do not pass personally identifiable information such as email or phone number directly.

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 can occur in the SDK.

Deprecated Class Migration

The following classes are deprecated and will be removed in a future version. Please migrate to the new classes.

AdropBanner → AdropBannerView

The AdropBanner widget is deprecated. Migrate to AdropBannerView.

AdropNavigatorObserver (Deprecated)

AdropNavigatorObserver is deprecated and will be removed in a future version. This class no longer provides any functionality and can be safely removed from your code.

Troubleshooting

iOS Build Errors

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

Android Build Errors

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