Prerequisites
- Minimum SDK version of
24or higher - Compile SDK version of
36or 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.- Kotlin
- Groovy
Adding the library dependency
Add the latest version of the SDK to your relevant module build.gradle.- Kotlin
- Groovy
CIMobileAdsConfiguration. This is achieved using CIMobileAdsConfiguration.Builder.
The builder takes one required parameter and two optional parameters:
publisherId: String: A unique identifier to identify the publisher in the Fusion platform.
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 toCIMobileAdsConfiguration.Builderin2.3.0to 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.
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 ofCIMobileAdsConfiguration.
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.
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.