Skip to main content

Prerequisites

  • Minimum SDK version of 24 or higher
  • Compile SDK version of 36 or higher

Migrate from v1 to v2

To migrate from version 1.5.1 to version 2.0.0, see this guide.

Installation

To install the SDK into your project, first add the repository to your project level Android gradle build file or settings gradle file.

Adding the library dependency

Add the latest version of the SDK to your relevant module build.gradle.
First we will create an instance of CIMobileAdsConfiguration. This is achieved using CIMobileAdsConfiguration.Builder. The builder takes two required parameter and two optional parameters:
  • publisherId: String: A unique identifier to identify the publisher in the Fusion platform.
  • googleId: String: Your Google Ad Manager application ID (ca-app-pub-...). Plug-and-play customers use the ID provided by Content Ignite; SaaS customers use their own Google Ad Manager account app ID — contact Content Ignite if you are unsure which applies.
Then call the build API to create the instance.
When creating an instance of CIMobileAdsConfiguration it is possible to enable optional features on the SDK, such as debugging via the setDebugFeature API (since version 1.2.0 the debug feature is enabled by default). This is discussed further in the Debug Features section.
  • setTestAds(enabled: Boolean) was added to CIMobileAdsConfiguration.Builder in 2.3.0 to control whether test ads are enabled, this was previously only possible from the debug menu. If this is set the Debug Menu option will be hidden and if not set the Debug Menu option will be used.
The initialisation step uses a singleton instance CIMobileAds. The initialise API is a suspending function and should be called from a background thread. It takes two required parameters:
  • context: The application context.
  • configuration: An instance of CIMobileAdsConfiguration.
The call to initialise the SDK should be made as early as possible in the application lifecycle.
If you are currently using Google Mobile Ads SDK, it is not required to initialise this separately, and this code should be removed. You should also remove the dependency in your build.gradle file. If you are migrating from the Google Mobile Ads SDK, do not assume your existing app ID is the one to pass as googleId — contact Content Ignite to confirm which ca-app-pub-... ID applies to your setup (plug-and-play accounts use Content Ignite’s app ID; SaaS accounts use their own).
The example below is taken from the demo application:

Select an ad format

Content Ignite Mobile SDK is now imported and you’re ready to implement an ad. We support both Jetpack Compose and View-Based UI. We offer a number of different formats:

App Open (Jetpack Compose)

Ads that appear when a user opens or switches back to your app.

App Open (View-Based)

Ads that appear when a user opens or switches back to your app.

Banner (Jetpack Compose)

Flexibly sized format for placing ads anywhere in your app.

Banner (View-Based)

Flexibly sized format for placing ads anywhere in your app.

Interstitial

Full-screen ads that are designed to appear between content transitions.