From 3f6ca79e136a43bb5f56859231349dbd15c4e71d Mon Sep 17 00:00:00 2001 From: CB-RyanMcCormick <122290337+CB-RyanMcCormick@users.noreply.github.com> Date: Thu, 7 Sep 2023 12:10:06 -0500 Subject: [PATCH 1/3] Committing changes for adaptive ad format --- CHANGELOG.md | 3 +++ README.md | 2 +- .../com/chartboost/mediation/vungleadapter/VungleAdapter.kt | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8842f7a..0ec4126 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.6.12.1.6 +- Updated to handle recent AdFormat changes. + ### 4.6.12.1.5 - Guard against multiple continuation resumes during ad load and show. diff --git a/README.md b/README.md index f8460e2..4495183 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.1.5" + implementation "com.chartboost:chartboost-mediation-adapter-vungle:4.6.12.1.6" ``` ## Contributions 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 f33b1e9..6fe7c75 100644 --- a/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt +++ b/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt @@ -366,7 +366,7 @@ class VungleAdapter : PartnerAdapter { PartnerLogController.log(LOAD_STARTED) return when (request.format) { - AdFormat.BANNER -> { + AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> { loadBannerAd(request, partnerAdListener) } AdFormat.INTERSTITIAL, AdFormat.REWARDED -> { @@ -398,7 +398,7 @@ class VungleAdapter : PartnerAdapter { return when (partnerAd.request.format) { // Banner ads do not have a separate "show" mechanism. - AdFormat.BANNER -> { + AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> { PartnerLogController.log(SHOW_SUCCEEDED) Result.success(partnerAd) } @@ -436,7 +436,7 @@ class VungleAdapter : PartnerAdapter { * For fullscreen ads, since Vungle does not provide an ad in the load callback, we don't * have an ad in PartnerAd to invalidate. */ - AdFormat.BANNER -> destroyBannerAd(partnerAd) + AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> destroyBannerAd(partnerAd) else -> { PartnerLogController.log(INVALIDATE_SUCCEEDED) Result.success(partnerAd) From 73f330fd9ae5f45e56ee1d25dcb7d0b8ed71c9d1 Mon Sep 17 00:00:00 2001 From: CB-RyanMcCormick <122290337+CB-RyanMcCormick@users.noreply.github.com> Date: Thu, 7 Sep 2023 12:53:20 -0500 Subject: [PATCH 2/3] Fixing the way adaptive_banner is used --- .../mediation/vungleadapter/VungleAdapter.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 6fe7c75..b1eb220 100644 --- a/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt +++ b/VungleAdapter/src/main/java/com/chartboost/mediation/vungleadapter/VungleAdapter.kt @@ -365,11 +365,11 @@ class VungleAdapter : PartnerAdapter { ): Result { PartnerLogController.log(LOAD_STARTED) - return when (request.format) { - AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> { + return when (request.format.key) { + AdFormat.BANNER.key, "adaptive_banner" -> { loadBannerAd(request, partnerAdListener) } - AdFormat.INTERSTITIAL, AdFormat.REWARDED -> { + AdFormat.INTERSTITIAL.key, AdFormat.REWARDED.key -> { loadFullscreenAd(request, partnerAdListener) } else -> { @@ -396,13 +396,13 @@ class VungleAdapter : PartnerAdapter { val listener = listeners.remove(partnerAd.request.identifier) - return when (partnerAd.request.format) { + return when (partnerAd.request.format.key) { // Banner ads do not have a separate "show" mechanism. - AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> { + AdFormat.BANNER.key, "adaptive_banner" -> { PartnerLogController.log(SHOW_SUCCEEDED) Result.success(partnerAd) } - AdFormat.INTERSTITIAL, AdFormat.REWARDED -> showFullscreenAd( + AdFormat.INTERSTITIAL.key, AdFormat.REWARDED.key -> showFullscreenAd( partnerAd, listener ) @@ -430,13 +430,13 @@ class VungleAdapter : PartnerAdapter { listeners.remove(partnerAd.request.identifier) adms.remove(partnerAd.request.partnerPlacement) - return when (partnerAd.request.format) { + return when (partnerAd.request.format.key) { /** * Only invalidate banner ads. * For fullscreen ads, since Vungle does not provide an ad in the load callback, we don't * have an ad in PartnerAd to invalidate. */ - AdFormat.BANNER, AdFormat.ADAPTIVE_BANNER -> destroyBannerAd(partnerAd) + AdFormat.BANNER.key, "adaptive_banner" -> destroyBannerAd(partnerAd) else -> { PartnerLogController.log(INVALIDATE_SUCCEEDED) Result.success(partnerAd) From 72d8bae87d1c19becba8f9a91a4eef194bf6d9ea Mon Sep 17 00:00:00 2001 From: CB-RyanMcCormick <122290337+CB-RyanMcCormick@users.noreply.github.com> Date: Fri, 8 Sep 2023 09:47:42 -0500 Subject: [PATCH 3/3] Update version --- VungleAdapter/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VungleAdapter/build.gradle.kts b/VungleAdapter/build.gradle.kts index 7eee271..ae37f93 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.5" + android.defaultConfig.versionName = System.getenv("VERSION_OVERRIDE") ?: "4.6.12.1.6" buildConfigField("String", "CHARTBOOST_MEDIATION_VUNGLE_ADAPTER_VERSION", "\"${android.defaultConfig.versionName}\"") consumerProguardFiles("proguard-rules.pro")