Overview
Adrop Flutter SDK allows you to easily integrate various ad formats into your Flutter app.Supported Ad Formats
| Format | Description |
|---|---|
| Banner Ad | Rectangular ads displayed in a portion of the screen |
| Native Ad | Ads that naturally blend with your app content |
| Interstitial Ad | Full-screen ads |
| Rewarded Ad | Full-screen ads that provide rewards |
| Popup Ad | Ads displayed in popup format |
| Splash Ad | Ads displayed with your logo when the app starts |
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
compileSdkVersion34- 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 toandroid/settings.gradle.kts.
android/settings.gradle.kts
android/app/build.gradle.
android/app/build.gradle
android/app/src/main/AndroidManifest.xml.
android/app/src/main/AndroidManifest.xml
Please contact Adrop to get your App ID.
3. iOS Setup
Modifyios/Podfile.
ios/Podfile
4. Info.plist Configuration
Add the following settings toios/Runner/Info.plist for backfill ads.
- GADApplicationIdentifier: App ID for backfill ads
- SKAdNetworkItems: Required for ad conversion tracking on iOS 14+
View Info.plist Configuration
View Info.plist Configuration
Info.plist
Please contact Adrop for the full SKAdNetworkItems list and App ID.
5. Add Configuration File
Android
- Download the adrop_service.json file from the Ad Control Console.
- Copy the file to the
android/app/src/main/assets/directory.
iOS
- Download the adrop_service.json file from the Ad Control Console.
- Add the file to the project root in Xcode.
- Make sure to add the file to all targets.
Initialization
Initialize the SDK at app startup. Typically called inmain.dart.
main.dart
Initialization Options
| Parameter | Type | Required | Description |
|---|---|---|---|
production | bool | Y | true: production mode, false: test mode |
targetCountries | List<String> | N | Country codes to show ads (e.g., ['KR', 'US']) |
useInAppBrowser | bool | N | iOS in-app browser usage (default: false) |
Theme Settings
Set the ad UI theme.| Theme | Description |
|---|---|
AdropTheme.auto | Automatically switches based on system settings |
AdropTheme.light | Light mode |
AdropTheme.dark | Dark mode |
Set User Identifier
Set a user identifier (UID) for targeted advertising.Test Unit IDs
Use the following test unit IDs during development and testing.| Format | Test Unit ID |
|---|---|
| Banner (320x50) | PUBLIC_TEST_UNIT_ID_320_50 |
| Banner (320x100) | PUBLIC_TEST_UNIT_ID_320_100 |
| Native | PUBLIC_TEST_UNIT_ID_NATIVE |
| Interstitial | PUBLIC_TEST_UNIT_ID_INTERSTITIAL |
| Rewarded | PUBLIC_TEST_UNIT_ID_REWARDED |
| Popup (Bottom) | PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM |
| Popup (Center) | PUBLIC_TEST_UNIT_ID_POPUP_CENTER |
| Splash | PUBLIC_TEST_UNIT_ID_SPLASH |
Error Codes
Error codes that can occur in the SDK.| Error Code | Description |
|---|---|
network | Network error |
internal | Internal error |
initialize | SDK initialization error |
invalidUnit | Invalid unit ID |
notTargetCountry | Not a target country |
inactive | Inactive ad |
adNoFill | No ads to display |
adLoadDuplicate | Duplicate load request |
adLoading | Loading in progress |
adEmpty | Empty ad |
adShown | Ad already shown |
adHideForToday | Hidden for today |
accountUsageLimitExceeded | Account usage limit exceeded |
adLandscapeUnsupported | Landscape mode not supported |
backfillNoFill | No backfill ads |
Deprecated Class Migration
The following classes are deprecated and will be removed in a future version. Please migrate to the new classes.AdropBanner → AdropBannerView
TheAdropBanner 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 thepost_install block in ios/Podfile.
ios/Podfile
Android Build Errors
If the Kotlin version doesn’t match, check the Kotlin version inandroid/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