Prerequisites
Targeting
- 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. Gradle Kotlin DSLAdding the library dependency
Add the latest version of the SDK to your relevant module build.gradle.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 Using 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 link the dependency in your build.gradle file.