Download SDK
Archive iabox_prebid-flutter-sdk-1.0.0.zip
Overview
Partner guide for integrating IABox Prebid Flutter SDK on iOS and Android.
The SDK wraps Prebid Mobile (iOS 3.3.0 / Android 3.3.1). Supports banner, interstitial and outstream video in Standalone mode (no third-party ad server).
Dart API is identical on both platforms. Native setup differs — see sections below.
Integration order
- Get the archive
iabox_prebid-flutter-sdk-1.0.0.zipfrom iaBox - Install — add plugin to
pubspec.yaml, runflutter pub get - Configure Android / iOS — manifest, Info.plist,
pod install - Initialize SDK —
IABoxPrebid.initialize()at app startup - Banner or outstream —
IABoxBanner/IABoxOutstreamVideoafter init
On iOS, request ATT permission before initialization when possible (see iOS setup).
SDK package
Archive iabox_prebid-flutter-sdk-1.0.0.zip contains folder iabox_prebid/ with plugin, guide and demo.
From your iaBox manager you also receive: configId, accountId, and optionally serverUrl (https://ia.box/ads/prebid).
iabox_prebid/
├── INTEGRATION.md
├── pubspec.yaml
├── lib/
├── android/
├── ios/
└── example/
import 'package:iabox_prebid/iabox_prebid.dart';
Requirements
| Parameter | Android | iOS |
|---|---|---|
| Flutter | >= 3.16.0 | >= 3.16.0 |
| Dart | >= 3.0.0 | >= 3.0.0 |
| min OS | Android 6.0 (API 23) | iOS 14.0 |
| compileSdk / Xcode | compileSdk 34 | Xcode 15.0+ |
| Prebid SDK | prebid-mobile-sdk 3.3.1 | PrebidMobile 3.3.0 |
Installation
1. Unpack the archive
Copy iabox_prebid into your Flutter project, e.g. packages/iabox_prebid/.
2. Add dependency
Option A — local path (archive from iaBox):
3. Install dependencies
Run flutter pub get. On iOS after first setup: cd ios && pod install.
4. Import
Available: IABoxPrebid, IABoxBanner, IABoxOutstreamVideo.
5. Platform setup
Configure Android and iOS as described in the next sections.
dependencies:
flutter:
sdk: flutter
iabox_prebid:
path: packages/iabox_prebid
dependencies:
iabox_prebid:
git:
url: URL_FROM_IABOX
ref: v1.0.0
cd packages/iabox_prebid/example
flutter pub get
cd ios && pod install && cd ..
flutter run
Android setup
Add permissions, queries for Android 11+ and AdBrowserActivity to AndroidManifest.xml. Set minSdk 23 in build.gradle.
android {
defaultConfig {
minSdk 23
targetSdk 34
}
}
android.useAndroidX=true
android.enableJetifier=true
iOS setup
Run pod install after flutter pub get. Add ATT description and ATS settings to Info.plist. Request ATT after UI is visible.
On iOS, banner creatives with adboxsdk.new.js are rendered via WKWebView inside the plugin — no extra native code required.
cd ios
pod install
cd ..
NSUserTrackingUsageDescription
This identifier will be used to deliver personalized ads to you.
NSAppTransportSecurity
NSAllowsArbitraryLoads
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
Future requestATT() async {
final status = await AppTrackingTransparency.trackingAuthorizationStatus;
if (status == TrackingStatus.notDetermined) {
await AppTrackingTransparency.requestTrackingAuthorization();
}
}
SDK initialization
Call once at app startup, before showing ads. Returns Future<bool>.
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | String | ✅ | Partner account ID (usually Bundle ID) |
serverUrl | String | ✅ | Prebid Server URL |
timeoutMs | int | ❌ (10000) | Auction timeout in ms |
shareGeoLocation | bool | ❌ (true) | Share geolocation with server |
SDK initializes once./statuscheck failure is not critical — bids still go to/openrtb2/auction.
await IABoxPrebid.initialize(
accountId: 'YOUR_ACCOUNT_ID',
serverUrl: 'https://ia.box/ads/prebid',
timeoutMs: 10000,
shareGeoLocation: true,
);
Future _initAds() async {
final success = await IABoxPrebid.initialize(
accountId: 'YOUR_ACCOUNT_ID',
serverUrl: 'https://ia.box/ads/prebid',
timeoutMs: 10000,
shareGeoLocation: true,
);
setState(() => _isAdReady = success);
}
Outstream video
Outstream plays in-app between content blocks. Use IABoxOutstreamVideo — Prebid renders video, no separate player needed.
Android: add AdBrowserActivity to manifest; onVideoCompleted and hideOnComplete supported.
iOS: onVideoCompleted / hideOnComplete not supported — remove widget manually after playback.
Do not place outstream in Offstage or zero-height container on first show (Android).IABoxOutstreamVideo(
configId: 'YOUR_VIDEO_CONFIG_ID',
width: 300,
height: 250,
protocols: const [2, 3, 4, 5],
hideOnComplete: true,
onAdLoaded: () {},
onAdFailed: () {},
onAdClicked: () {},
onVideoCompleted: () {},
)
Privacy / GDPR
Call setPrivacyConfig before loading ads. Supports IAB TCF v2 and GPP strings.
await IABoxPrebid.setPrivacyConfig(
tcfString: 'CPxxxxxxxxxxxxxxxxx',
gppString: 'DBABMA~CPxxxx',
gppSid: [7],
);
Events & callbacks
Widget callbacks: onAdLoaded, onAdFailed, onAdClicked, onVideoCompleted (Android only).
Global stream: IABoxPrebid.events.listen(...) — onBannerLoaded, onBannerFailed, onVideoLoaded, etc.
final sub = IABoxPrebid.events.listen((event) {
switch (event['method']) {
case 'onBannerLoaded':
break;
case 'onBannerFailed':
break;
case 'onVideoCompleted':
break;
}
});
Troubleshooting
| Issue | Solution |
|---|---|
initialize() returns false | Check serverUrl and accountId; increase timeoutMs |
| Banner not shown | Ensure init succeeded; verify configId on server |
| Package not found | Add path: in pubspec, run flutter pub get |
| Android: click not opening browser | Add AdBrowserActivity to manifest |
| iOS: No module PrebidMobile | Run cd ios && pod install |
| deviceId all zeros | User denied ATT — check NSUserTrackingUsageDescription |
Demo app
Full working example is in example/ inside the SDK package.
| Plugin | Prebid iOS | Prebid Android |
|---|---|---|
| 1.0.0 | 3.3.0 | 3.3.1 |