diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe2adf..1b303d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,5 +3,8 @@ 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.2.17.0.1 +- Updated to handle recent AdFormat changes. + ### 4.2.17.0.0 - This version of the adapter has been certified with HyBid SDK 2.17.0. diff --git a/README.md b/README.md index a8dd44a..f6d2290 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Chartboost Mediation Verve adapter mediates HyBid via the Chartboost Mediati In your `build.gradle`, add the following entry: ``` - implementation "com.chartboost:chartboost-mediation-adapter-verve:4.2.17.0.0" + implementation "com.chartboost:chartboost-mediation-adapter-verve:4.2.17.0.1" ``` ## Contributions diff --git a/VerveAdapter/build.gradle.kts b/VerveAdapter/build.gradle.kts index 3a6a3c2..6763e6d 100644 --- a/VerveAdapter/build.gradle.kts +++ b/VerveAdapter/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.2.17.0.0" + android.defaultConfig.versionName = System.getenv("VERSION_OVERRIDE") ?: "4.2.17.0.1" buildConfigField("String", "CHARTBOOST_MEDIATION_VERVE_ADAPTER_VERSION", "\"${android.defaultConfig.versionName}\"") consumerProguardFiles("proguard-rules.pro") diff --git a/VerveAdapter/src/main/java/com/chartboost/mediation/verveadapter/VerveAdapter.kt b/VerveAdapter/src/main/java/com/chartboost/mediation/verveadapter/VerveAdapter.kt index bb2e1dc..208e9c2 100644 --- a/VerveAdapter/src/main/java/com/chartboost/mediation/verveadapter/VerveAdapter.kt +++ b/VerveAdapter/src/main/java/com/chartboost/mediation/verveadapter/VerveAdapter.kt @@ -187,9 +187,9 @@ class VerveAdapter : PartnerAdapter { ): Result { PartnerLogController.log(LOAD_STARTED) - return when (request.format) { - AdFormat.BANNER -> loadBannerAd(context, request, partnerAdListener) - AdFormat.INTERSTITIAL, AdFormat.REWARDED -> loadFullscreenAd(context, request, partnerAdListener) + return when (request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> loadBannerAd(context, request, partnerAdListener) + AdFormat.INTERSTITIAL.key, AdFormat.REWARDED.key -> loadFullscreenAd(context, request, partnerAdListener) else -> { PartnerLogController.log(LOAD_FAILED) Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_LOAD_FAILURE_UNSUPPORTED_AD_FORMAT)) @@ -217,12 +217,12 @@ class VerveAdapter : PartnerAdapter { } } - return when (partnerAd.request.format) { - AdFormat.BANNER -> { + return when (partnerAd.request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> { PartnerLogController.log(SHOW_SUCCEEDED) Result.success(partnerAd) } - AdFormat.INTERSTITIAL -> { + AdFormat.INTERSTITIAL.key -> { loadIdToHyBidInterstitialAds[partnerAd.request.identifier]?.let { showAdIfReady(it::isReady, it::show) } ?: run { @@ -230,7 +230,7 @@ class VerveAdapter : PartnerAdapter { Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_INVALIDATE_FAILURE_AD_NOT_FOUND)) } } - AdFormat.REWARDED -> { + AdFormat.REWARDED.key -> { loadIdToHyBidRewardedAds[partnerAd.request.identifier]?.let { showAdIfReady(it::isReady, it::show) } ?: run { @@ -255,9 +255,9 @@ class VerveAdapter : 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 -> destroyFullscreenAd(partnerAd) + return when (partnerAd.request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> destroyBannerAd(partnerAd) + AdFormat.INTERSTITIAL.key, AdFormat.REWARDED.key -> destroyFullscreenAd(partnerAd) else -> { PartnerLogController.log(INVALIDATE_SUCCEEDED) Result.success(partnerAd) @@ -444,8 +444,8 @@ class VerveAdapter : PartnerAdapter { listener: PartnerAdListener ): Result { return suspendCancellableCoroutine { continuation -> - when(request.format) { - AdFormat.INTERSTITIAL -> { + when(request.format.key) { + AdFormat.INTERSTITIAL.key -> { HyBidInterstitialAd( context, request.partnerPlacement, @@ -459,7 +459,7 @@ class VerveAdapter : PartnerAdapter { } } } - AdFormat.REWARDED -> { + AdFormat.REWARDED.key -> { HyBidRewardedAd( context, request.partnerPlacement, @@ -618,8 +618,8 @@ class VerveAdapter : PartnerAdapter { return Result.success(partnerAd) } - return when (partnerAd.request.format) { - AdFormat.INTERSTITIAL -> { + return when (partnerAd.request.format.key) { + AdFormat.INTERSTITIAL.key -> { loadIdToHyBidInterstitialAds.remove(partnerAd.request.identifier)?.let { destroyAd(it::destroy) } ?: run { @@ -627,7 +627,7 @@ class VerveAdapter : PartnerAdapter { Result.success(partnerAd) } } - AdFormat.REWARDED-> { + AdFormat.REWARDED.key-> { loadIdToHyBidRewardedAds.remove(partnerAd.request.identifier)?.let { destroyAd(it::destroy) } ?: run {