IABox Prebid Flutter SDK

Dart · iOS · Android

Cross-platform ad integration via Prebid Mobile SDK. Banner and outstream video.

Download SDK

Archive iabox_prebid-flutter-sdk-1.0.0.zip

Download 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

  1. Get the archive iabox_prebid-flutter-sdk-1.0.0.zip from iaBox
  2. Install — add plugin to pubspec.yaml, run flutter pub get
  3. Configure Android / iOS — manifest, Info.plist, pod install
  4. Initialize SDKIABoxPrebid.initialize() at app startup
  5. Banner or outstreamIABoxBanner / IABoxOutstreamVideo after 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

ParameterAndroidiOS
Flutter>= 3.16.0>= 3.16.0
Dart>= 3.0.0>= 3.0.0
min OSAndroid 6.0 (API 23)iOS 14.0
compileSdk / XcodecompileSdk 34Xcode 15.0+
Prebid SDKprebid-mobile-sdk 3.3.1PrebidMobile 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>.

ParameterTypeRequiredDescription
accountIdStringPartner account ID (usually Bundle ID)
serverUrlStringPrebid Server URL
timeoutMsint❌ (10000)Auction timeout in ms
shareGeoLocationbool❌ (true)Share geolocation with server
SDK initializes once. /status check 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

IssueSolution
initialize() returns falseCheck serverUrl and accountId; increase timeoutMs
Banner not shownEnsure init succeeded; verify configId on server
Package not foundAdd path: in pubspec, run flutter pub get
Android: click not opening browserAdd AdBrowserActivity to manifest
iOS: No module PrebidMobileRun cd ios && pod install
deviceId all zerosUser denied ATT — check NSUserTrackingUsageDescription

Demo app

Full working example is in example/ inside the SDK package.

PluginPrebid iOSPrebid Android
1.0.03.3.03.3.1