diff --git a/CHANGELOG.md b/CHANGELOG.md index 133c8d4..5185945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Note the first digit of every adapter version corresponds to the major version of the Chartboost Mediation SDK compatible with that adapter. Adapters are compatible with any Chartboost Mediation SDK version within that major version. +### 4.9.4.1.2 +- Updated to handle recent AdFormat changes. + ### 4.9.4.1.1 - Guard against multiple continuation resumes. diff --git a/ChartboostAdapter/build.gradle.kts b/ChartboostAdapter/build.gradle.kts index 79b4f6d..e4ab098 100644 --- a/ChartboostAdapter/build.gradle.kts +++ b/ChartboostAdapter/build.gradle.kts @@ -36,7 +36,7 @@ android { minSdk = 21 targetSdk = 33 // If you touch the following line, don't forget to update scripts/get_rc_version.zsh - android.defaultConfig.versionName = System.getenv("VERSION_OVERRIDE") ?: "4.9.4.1.1" + android.defaultConfig.versionName = System.getenv("VERSION_OVERRIDE") ?: "4.9.4.1.2" buildConfigField("String", "CHARTBOOST_MEDIATION_CHARTBOOST_ADAPTER_VERSION", "\"${android.defaultConfig.versionName}\"") consumerProguardFiles("proguard-rules.pro") diff --git a/ChartboostAdapter/src/main/java/com/chartboost/mediation/chartboostadapter/ChartboostAdapter.kt b/ChartboostAdapter/src/main/java/com/chartboost/mediation/chartboostadapter/ChartboostAdapter.kt index ed48a0e..8f3e212 100644 --- a/ChartboostAdapter/src/main/java/com/chartboost/mediation/chartboostadapter/ChartboostAdapter.kt +++ b/ChartboostAdapter/src/main/java/com/chartboost/mediation/chartboostadapter/ChartboostAdapter.kt @@ -286,10 +286,10 @@ class ChartboostAdapter : PartnerAdapter { ): Result { PartnerLogController.log(LOAD_STARTED) - return when (request.format) { - AdFormat.BANNER -> loadBannerAd(context, request, partnerAdListener) - AdFormat.INTERSTITIAL -> loadInterstitialAd(request, partnerAdListener) - AdFormat.REWARDED -> loadRewardedAd(request, partnerAdListener) + return when (request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> loadBannerAd(context, request, partnerAdListener) + AdFormat.INTERSTITIAL.key -> loadInterstitialAd(request, partnerAdListener) + AdFormat.REWARDED.key -> loadRewardedAd(request, partnerAdListener) else -> { PartnerLogController.log(LOAD_FAILED) Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_LOAD_FAILURE_UNSUPPORTED_AD_FORMAT)) @@ -308,14 +308,14 @@ class ChartboostAdapter : PartnerAdapter { override suspend fun show(context: Context, partnerAd: PartnerAd): Result { PartnerLogController.log(SHOW_STARTED) - return when (partnerAd.request.format) { - AdFormat.BANNER -> { + return when (partnerAd.request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> { // Banner ads do not have a separate "show" mechanism. PartnerLogController.log(SHOW_SUCCEEDED) Result.success(partnerAd) } - AdFormat.INTERSTITIAL -> showInterstitialAd(partnerAd) - AdFormat.REWARDED -> showRewardedAd(partnerAd) + AdFormat.INTERSTITIAL.key -> showInterstitialAd(partnerAd) + AdFormat.REWARDED.key -> showRewardedAd(partnerAd) else -> { PartnerLogController.log(SHOW_FAILED) Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_SHOW_FAILURE_UNSUPPORTED_AD_FORMAT)) @@ -333,9 +333,9 @@ class ChartboostAdapter : PartnerAdapter { override suspend fun invalidate(partnerAd: PartnerAd): Result { PartnerLogController.log(INVALIDATE_STARTED) - return when (partnerAd.request.format) { - AdFormat.BANNER -> destroyBannerAd(partnerAd) - AdFormat.INTERSTITIAL, AdFormat.REWARDED -> { + return when (partnerAd.request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> destroyBannerAd(partnerAd) + AdFormat.INTERSTITIAL.key, AdFormat.REWARDED.key -> { // Chartboost does not have destroy methods for their fullscreen ads. PartnerLogController.log(INVALIDATE_SUCCEEDED) Result.success(partnerAd) diff --git a/README.md b/README.md index 65ee03b..d4bfc52 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Chartboost Mediation Chartboost adapter mediates Chartboost via the Chartboo In your `build.gradle`, add the following entry: ``` - implementation "com.chartboost:chartboost-mediation-adapter-chartboost:4.9.4.1.1" + implementation "com.chartboost:chartboost-mediation-adapter-chartboost:4.9.4.1.2" ``` ## Contributions