diff --git a/CHANGELOG.md b/CHANGELOG.md index b7cfa27..24b4e8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,14 @@ 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.6.12.1.1 +- Update the dependency on Chartboost Mediation SDK to 4.0.0. + ### 4.6.12.1.0 - This version of the adapter has been certified with Vungle SDK 6.12.1. +### 4.6.12.0.1 +- Update the dependency on Chartboost Mediation SDK to 4.0.0. + ### 4.6.12.0.0 - This version of the adapter has been certified with Vungle SDK 6.12.0. diff --git a/README.md b/README.md index 15a8844..633fc96 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Chartboost Mediation Vungle adapter mediates Vungle via the Chartboost Media In your `build.gradle`, add the following entry: ``` - implementation "com.chartboost:chartboost-mediation-adapter-vungle:4.6.12.0.0" + implementation "com.chartboost:chartboost-mediation-adapter-vungle:4.6.12.1.1" ``` ## Contributions diff --git a/VungleAdapter/build.gradle.kts b/VungleAdapter/build.gradle.kts index 8d67559..75f8606 100644 --- a/VungleAdapter/build.gradle.kts +++ b/VungleAdapter/build.gradle.kts @@ -35,7 +35,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.6.12.1.0" + android.defaultConfig.versionName = System.getenv("VERSION_OVERRIDE") ?: "4.6.12.1.1" buildConfigField("String", "CHARTBOOST_MEDIATION_VUNGLE_ADAPTER_VERSION", "\"${android.defaultConfig.versionName}\"") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -67,7 +67,7 @@ dependencies { // For external usage, please use the following production dependency. // You may choose a different release version. - "remoteImplementation"("com.chartboost:chartboost-mediation-sdk:4.+") + "remoteImplementation"("com.chartboost:chartboost-mediation-sdk:4.0.0") // Partner SDK implementation("com.vungle:publisher-sdk-android:6.12.1") diff --git a/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt b/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt index 04401b8..8766aa5 100644 --- a/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt +++ b/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt @@ -130,7 +130,7 @@ class VungleAdapter : PartnerAdapter { } /** - * A map of Chartboost Mediation's listeners for the corresponding Chartboost placements. + * A map of Chartboost Mediation's listeners for the corresponding load identifier. */ private val listeners = mutableMapOf() @@ -359,6 +359,10 @@ class VungleAdapter : PartnerAdapter { AdFormat.INTERSTITIAL, AdFormat.REWARDED -> { loadFullscreenAd(request, partnerAdListener) } + else -> { + PartnerLogController.log(LOAD_FAILED) + Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_LOAD_FAILURE_UNSUPPORTED_AD_FORMAT)) + } } } @@ -373,7 +377,7 @@ class VungleAdapter : PartnerAdapter { override suspend fun show(context: Context, partnerAd: PartnerAd): Result { PartnerLogController.log(SHOW_STARTED) - val listener = listeners.remove(partnerAd.request.chartboostPlacement) + val listener = listeners.remove(partnerAd.request.identifier) return when (partnerAd.request.format) { // Banner ads do not have a separate "show" mechanism. @@ -382,6 +386,10 @@ class VungleAdapter : PartnerAdapter { Result.success(partnerAd) } AdFormat.INTERSTITIAL, AdFormat.REWARDED -> showFullscreenAd(partnerAd, listener) + else -> { + PartnerLogController.log(SHOW_FAILED) + Result.failure(ChartboostMediationAdException(ChartboostMediationError.CM_SHOW_FAILURE_UNSUPPORTED_AD_FORMAT)) + } } } @@ -395,7 +403,7 @@ class VungleAdapter : PartnerAdapter { override suspend fun invalidate(partnerAd: PartnerAd): Result { PartnerLogController.log(INVALIDATE_STARTED) - listeners.remove(partnerAd.request.chartboostPlacement) + listeners.remove(partnerAd.request.identifier) adms.remove(partnerAd.request.partnerPlacement) return when (partnerAd.request.format) { @@ -405,7 +413,7 @@ class VungleAdapter : PartnerAdapter { * have an ad in PartnerAd to invalidate. */ AdFormat.BANNER -> destroyBannerAd(partnerAd) - AdFormat.INTERSTITIAL, AdFormat.REWARDED -> { + else -> { PartnerLogController.log(INVALIDATE_SUCCEEDED) Result.success(partnerAd) } @@ -593,7 +601,7 @@ class VungleAdapter : PartnerAdapter { listener: PartnerAdListener ): Result { // Save the listener for later use. - listeners[request.chartboostPlacement] = listener + listeners[request.identifier] = listener // Vungle needs a nullable adm instead of an empty string for non-programmatic ads. val adm = if (request.adm?.isEmpty() == true) null else request.adm