Skip to main content

Migrate Version 1.5.1 to 2.0.0

Version 2.0.0 introduced some breaking changes which warranted this short guide.

1. Update AndroidManifest.xml

Before version 2.0.0 it was required to have the following metadata inside the application tag in the AndroidManifest.xml:
<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-3940256099942544~3347511713"/>
This can now be removed. This ID will be moved in the next step.

2. Update SDK Initialisation

Update to the new SDK configuration API which now requires the Google application ID as a parameter:
val configuration = CIMobileAdsConfiguration.Builder(
    publisherId = "<PUBLISHER-ID>",
    googleId = "ca-app-pub-3940256099942544~3347511713" // New required paramter
)
.setDebugFeature(true)
.enableAppOpen("<PLACEMENT-ID>") // only required if using App Open ads
.build()

3. Interstitial ads

If your application uses Interstitial ads, the CIInterstitialAd API no longer requires the context parameter, so this can be removed:
val interstitial = CIInterstitialAd(
    placementID = "<PLACEMENT-ID>",
    eventListener = eventListener,
    pageUrl = "https://example.com/sport"
)