Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ThirdPartyAdapters/verve/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Verve Android Mediation Adapter Changelog

#### Next Version
- Filter age-restricted requests for Verve SDK when new `AgeRestrictedTreatment` is set to `CHILD`.

#### Version 3.8.1.1
- Filter clickable views to differentiate content info click from regular ad click for VerveNativeAd.

Expand Down
2 changes: 1 addition & 1 deletion ThirdPartyAdapters/verve/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext {
kotlinVersion = '2.1.10'
kotlinVersion = '2.3.0'
}
repositories {
google()
Expand Down
251 changes: 251 additions & 0 deletions ThirdPartyAdapters/verve/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions ThirdPartyAdapters/verve/verve/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ dependencies {
implementation 'androidx.core:core-ktx:1.13.1'
// Check for a 'useNextGenGma' flag to use the next generation GMA SDK.
if (project.hasProperty('useNextGenGma')) {
implementation 'com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.0.1'
implementation 'com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.1.0'
} else {
implementation 'com.google.android.gms:play-services-ads:25.2.0'
implementation 'com.google.android.gms:play-services-ads:25.3.0'
}
implementation 'net.pubnative:hybid.sdk:3.8.1'

Expand All @@ -146,7 +146,7 @@ dependencies {
testImplementation "com.google.truth:truth:1.1.5"
testImplementation 'junit:junit:4.13.2'
testImplementation "org.jacoco:org.jacoco.core:$jacocoVersion"
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.10'
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:2.3.0'
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.1.0'
testImplementation 'org.robolectric:robolectric:4.9'
testImplementation project(':adaptertestkit')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import android.app.Application
import android.content.Context
import android.util.Log
import androidx.annotation.VisibleForTesting
import com.google.android.gms.ads.AgeRestrictedTreatment
import com.google.android.gms.ads.MobileAds
import com.google.android.gms.ads.RequestConfiguration
import com.google.android.gms.ads.VersionInfo
Expand Down Expand Up @@ -105,7 +106,8 @@ class VerveMediationAdapter : RtbAdapter() {
(requestConfiguration.tagForChildDirectedTreatment ==
RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE) ||
requestConfiguration.tagForUnderAgeOfConsent ==
RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE
RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE ||
requestConfiguration.ageRestrictedTreatment == AgeRestrictedTreatment.CHILD
if (isChildUser) {
initializationCompleteCallback.onInitializationFailed(ERROR_MSG_CHILD_USER)
return
Expand Down Expand Up @@ -204,6 +206,7 @@ class VerveMediationAdapter : RtbAdapter() {
const val APP_TOKEN_KEY = "AppToken"
const val ADAPTER_ERROR_DOMAIN = "com.google.ads.mediation.verve"
const val SDK_ERROR_DOMAIN = "net.pubnative.lite.sdk"

// Older versions of the adapter logged error code 101 for UNSUPPORTED_AD_SIZE. Please don't use
// 101 for a new error code.
const val ERROR_CODE_AD_LOAD_FAILED_TO_LOAD = 102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.google.ads.mediation.verve.VerveMediationAdapter.Companion.ERROR_MSG_
import com.google.ads.mediation.verve.VerveMediationAdapter.Companion.ERROR_MSG_MISSING_APP_TOKEN
import com.google.android.gms.ads.AdFormat
import com.google.android.gms.ads.AdSize
import com.google.android.gms.ads.AgeRestrictedTreatment
import com.google.android.gms.ads.MobileAds
import com.google.android.gms.ads.RequestConfiguration
import com.google.android.gms.ads.RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE
Expand Down Expand Up @@ -70,15 +71,12 @@ class VerveMediationAdapterTest {

@After
fun tearDown() {
// Reset child-directed and under-age tags.
// Reset child-directed, under-age, and age-restricted tags.
MobileAds.setRequestConfiguration(
RequestConfiguration.Builder()
.setTagForChildDirectedTreatment(TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED)
.build()
)
MobileAds.setRequestConfiguration(
RequestConfiguration.Builder()
.setTagForUnderAgeOfConsent(TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED)
.setAgeRestrictedTreatment(AgeRestrictedTreatment.UNSPECIFIED)
.build()
)
}
Expand Down Expand Up @@ -143,6 +141,16 @@ class VerveMediationAdapterTest {
verify(mockInitializationCallback).onInitializationFailed(eq(ERROR_MSG_CHILD_USER))
}

@Test
fun initialize_whenAgeRestrictedTreatmentChild_invokesOnInitializationFailed() {
MobileAds.setRequestConfiguration(
RequestConfiguration.Builder().setAgeRestrictedTreatment(AgeRestrictedTreatment.CHILD).build()
)
adapter.initialize(context, mockInitializationCallback, mediationConfigurations = listOf())

verify(mockInitializationCallback).onInitializationFailed(eq(ERROR_MSG_CHILD_USER))
}

@Test
fun initialize_withEmptyConfiguration_invokesOnInitializationFailed() {
adapter.initialize(context, mockInitializationCallback, mediationConfigurations = listOf())
Expand Down
Loading