ironSource Flutter Plugin

A bridge plugin for ironSource SDKs.

Getting Started


flutter pub get ironsource_mediation

Android Configuration

  • The ironSource SDK dependency is included in the plugin, so you do not have to add manually to your build.gradle.

Gradle Dependencies Required

  • Play Services dependencies must be added to PROJECT_ROOT/android/app/build.gradle.
// PROJECT_ROOT/android/app/build.gradle
dependencies {
  implementation ''
  implementation ''
  implementation ''


After adding the plugin to the pubspec.yml, Android build fails with the error below:

Attribute application@label value=(your_app_label) from AndroidManifest.xml:11:9-40
  is also present at [com.ironsource.sdk:mediationsdk:7.2.1] AndroidManifest.xml:15:9-41 value=(@string/app_name).

To prevent this, do the following:

  • Add xmls:tools to AndroidManifest.xml of your project.
  • Add tools:replace="android:label" to the application tag.

iOS Configuration

  • The ironSource SDK pod is included in the plugin, so you do not have to add it to your Podfile.

SKAdNetwork Support

Add the SKAN ID of ironSource Network on info.plist


App Transport Security Settings

Set NSAllowsArbitraryLoads: true on info.plist to allow http as some mediated networks require http calls. (Note: ironSource Network calls are all encrypted.)



App Tracking Transparency (ATT) Prompt

TODO: Remove or keep this?

Implement the ATT prompt to request user authorization for app-related data.

  • Note: This is not part of ironSource SDK but a bridge for AppTrackingTransparency ATTrackingManager.
  • You have to add NSUserTrackingUsageDescription to your info.plist if you intend to call this API.
Future<void> checkATT() async {
  final currentStatus = await ATTrackingManager.getTrackingAuthorizationStatus();
  if (currentStatus == ATTStatus.NotDetermined) {
    final returnedStatus = await ATTrackingManager.requestTrackingAuthorization();
    print('ATTStatus returned: $returnedStatus');

Read more about Apple's ATT and user privacy guideline here.

General Usage

Implement Listeners

class YourDartClass with IronSourceRewardedVideoListener {
  /// RV listener
  void onRewardedVideoAdClicked(IronSourceRVPlacement placement) {
    print('onRewardedVideoAdClicked Placement:$placement');

  void onRewardedVideoAdClosed() {

  void onRewardedVideoAdEnded() {

  void onRewardedVideoAdOpened() {

  void onRewardedVideoAdRewarded(IronSourceRVPlacement placement) {
    print("onRewardedVideoAdRewarded Placement: $placement");

  void onRewardedVideoAdShowFailed(IronSourceError error) {
    print("onRewardedVideoAdShowFailed Error:$error");

  void onRewardedVideoAdStarted() {

  void onRewardedVideoAvailabilityChanged(bool isAvailable) {
    print('onRewardedVideoAvailabilityChanged: $isAvailable');
    // Change the RV show button active state here
      _isRVAvailable = isAvailable;

Initialize the plugin

Future<void> initIronSource() async {
  final appKey = Platform.isAndroid
      : Platform.isIOS
          ? IOS_APP_KEY
          : throw Exception("Unsupported Platform");
  try {
    IronSource.setFlutterVersion('2.8.1'); // must be called before init
    await IronSource.setAdaptersDebug(true);
    await IronSource.shouldTrackNetworkState(true);

    // Do not use GAID or IDFA for this.
    await IronSource.setUserId("unique-application-user-id");
    await IronSource.init(appKey: appKey, adUnits: [IronSourceAdUnit.RewardedVideo]);
  } on PlatformException catch (e) {

Show Ads

Future<void> _showRVOnClick() async {
  if (await IronSource.isRewardedVideoAvailable()) {

Refer to the example app for the more detailed implementation sample.


  • Make sure to read the official documents at ironSource Knowledge Center(TODO: replace with the real KC link) for proper usage.
  • Some configurations must be done before IronSource.init.

For the native SDKs, a banner view must be implemented directly to the UI component. This bridge takes care of native level view implementation. Therefore, positioning parameters are provided as below:


enum IronSourceBannerPosition {


This parameter represents the vertical offset of the banner:

  • Negative values: Upward offset
  • Positive values: Downward offset


  • Android: dp
  • iOS: point


  • Offset in the same direction of the position will be ignored. e.g. Bottom & 50, Top & -50
  • However, the offsets in the opposite direction or both directions on the Center position can go beyond the screen boundaries. e.g. Bottom & -10000
  • Make sure that a banner presented will be visible
  size: IronSourceBannerSize.BANNER,
  position: IronSourceBannerPosition.Bottom,
  verticalOffset: -50, // adding 50dp/50point margin bottom
  placementName: 'YOUR_PLACEMENT');


  • You can use the ironSource LevelPlay's mediation feature by adding adapters/SDKs to your project.
  • Some networks require additional configurations.
  • Make sure to use the compatible adapter versions.


Make sure to follow ironSource Knowledge Center document for additional setup.

  • Add dependencies to YOUR_PROJECT/android/app/build.gradle
  • Add required settings to YOUR_PROJECT/android/app/src/main/AndroidManifest.xml


Make sure to follow ironSource Knowledge Center document for additional setup.

  • Add pod dependencies to YOUR_PROJECT/ios/Podfile: target 'Runner'
  • Add required settings to YOUR_PROJECT/ios/Runner/info.plist


use_frameworks! :linkage => :static