CAS.AI plugin for Flutter

Integrating CAS SDK into an app is the first step toward displaying ads and earning revenue. Once you've integrated and initialized the SDK, you can choose an ad format and follow the steps to implement it.

Prerequisites

Make sure that your app's build file uses the following values:

  • Use Flutter 3.0.0 or higher
  • For Android:
    • Minimum API level 24 or higher
  • For iOS:
    • Use Xcode 26.2 or higher
    • Minimum Target iOS version 13.0 or higher

Import CAS.AI Mobile Ads package

Include the CAS.AI plugin for Flutter in your Flutter project.

With Flutter command:

shell
flutter pub add clever_ads_solutions
Subscribe
Subscribe

Subscribe to receive notifications about CAS updates.

Now in your Dart code, you can use:

dart
import 'package:clever_ads_solutions/clever_ads_solutions.dart';

Platform specific setup

To monetize your app using CAS.AI mediation, in addition to importing the package, you need to configure your Android and iOS projects by using the CAS Gradle plugin for Android and a Ruby CAS script for iOS.

The CAS Android SDK provide a Gradle Plugin to simplify and automate certain integration steps. Our plugin will automatically add mediated network dependencies to your project, which you configure in an cas { } block.

In your Android app Gradle file (usually <project>/android/app/build.gradle), add the com.cleveradssolutions.gradle-plugin inside the plugins block.

kotlin
plugins {
  id("com.android.application") // before CAS plugin
  id("com.cleveradssolutions.gradle-plugin") version "4.8.0"
}

cas {
  // Plugin configuration
}

Choose Mediated Networks

Choose an integration path based on your app's target audience. If you're unsure which solution best fits your application, please contact your account manager.

Check the details of the ad network adapters supported by CAS.AI Mediation in the Android repository and iOS repository tables.

Recommended for most applications targeting a general or mixed audience. Includes a broad set of stable, high-performance networks.

// <project>/android/app/build.gradle
cas {
    includeOptimalAds = true
}

Advertising Identifier

CAS Mediation uses the Google Advertising ID and Apple Identifier for Advertisers (IDFA) to deliver personalized and more relevant ads to each user.
To enable the use of the Advertising ID in your app, you need to complete the following setup steps.