SDK Migration - cleveradssolutions/CAS-Android GitHub Wiki

This page covers migrations for current and previous versions.

Migrate from 2.x to 3.0

Starting from version 3.0.0, the CleverAdsSolutions SDK requires all apps to be on a minimum Android API level 21 to run. To adjust the API level, change the value of  minSdkVersion in your app’s build file to 21 or higher.

The table below lists the removed/replaced methods in version 3.0.

CAS

Removed New
.buildManager(activity): ManagerBuilder .buildManager(): ManagerBuilder
.initialize(activity, managerID) .buildManager().withCasId(managerID).initialize(activity)

ManagerBuilder

Removed New
.withInitListener(listener: OnInitializationListener) .withCompletionListener(listener: InitializationListener)
.initialize() initialize(application: Application)

MediationManager

Removed New
.loadRewardedVideo() .loadRewardedAd()
.bannerSize: AdSize CASBannerView.size: AdSize
.hideBanner() CASBannerView.setVisibility(View.GONE)
.isAdReady(type): Boolean .isInterstitialReady: Boolean, isRewardedAdReady: Boolean
.show(type, callback) .showInterstitial(activity, callback), .showRewardedAd(activity, callback)
.isValidCallback(type, callback): Boolean No longer supported
.setManualPauseControl(isManual) No longer supported
.onPause() No longer supported
.onResume() No longer supported
.getLastActiveMediation(type) No longer supported

CASBannerView

Removed New
.loadCallback: LoadAdCallback .adListener: AdViewListener
.contentCallback: AdCallback .adListener: AdViewListener
.listener: AdCallback .adListener: AdViewListener
.position: AdPosition .gravity: Int
.isRefreshAdaptiveSizeWhenChangingOrientation: Boolean .isAutoloadEnabled: Boolean

AdSize

Removed New
.Standard320x50 .BANNER
.Default .BANNER

AdsSettings

Removed New
.consent: Boolean .userConsent: Int
.doNotSell: Boolean .ccpaStatus: Int
.isTaggedForChildren: Boolean .taggedAudience: Int
.testDeviceIDs: MutableSet<String> .testDeviceIDs: Set<String>
.setPluginPlatform(name, version) CAS.buildManager().withFramework(name, version)
.isExecuteCallbacksInUIThread: Boolean Callbacks from background thread is no longer supported.
⚠️ **GitHub.com Fallback** ⚠️