Skip to content

Commit a4af95b

Browse files
Mobile Ads Developer Relationscopybara-github
authored andcommitted
Added the watermark to the DtExchange ad load method.
PiperOrigin-RevId: 764822047
1 parent 7b839fe commit a4af95b

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

ThirdPartyAdapters/dtexchange/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Built and tested with:
2020

2121
#### Version 8.4.0.0
2222
- Removed class-level references to Context. Can help reduce memory leak issues.
23+
- Added watermark on bidding ads.
2324
- Verified compatibility with DT Exchange SDK 8.4.0.
2425

2526
Built and tested with:

ThirdPartyAdapters/dtexchange/dtexchange/src/main/java/com/google/ads/mediation/fyber/DTExchangeBannerAd.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class DTExchangeBannerAd(
4141
adSpot.setRequestListener(this)
4242
controller.eventsListener = this
4343
FyberAdapterUtils.updateFyberExtraParams(mediationBannerAdConfiguration.mediationExtras)
44-
adSpot.loadAd(bidResponse)
44+
val watermark = mediationBannerAdConfiguration.watermark
45+
adSpot.loadAd(bidResponse, watermark)
4546
}
4647

4748
override fun onInneractiveSuccessfulAdRequest(iAdSpot: InneractiveAdSpot?) {

ThirdPartyAdapters/dtexchange/dtexchange/src/main/java/com/google/ads/mediation/fyber/DTExchangeInterstitialAd.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class DTExchangeInterstitialAd(
4242
adSpot.setRequestListener(this)
4343
controller.eventsListener = this
4444
FyberAdapterUtils.updateFyberExtraParams(mediationInterstitialAdConfiguration.mediationExtras)
45-
adSpot.loadAd(bidResponse)
45+
val watermark = mediationInterstitialAdConfiguration.watermark
46+
adSpot.loadAd(bidResponse, watermark)
4647
}
4748

4849
override fun showAd(context: Context) {

ThirdPartyAdapters/dtexchange/dtexchange/src/main/java/com/google/ads/mediation/fyber/FyberRewardedVideoRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ void loadWaterfallAd(MediationRewardedAdConfiguration adConfiguration) {
9191
void loadRtbAd(MediationRewardedAdConfiguration adConfiguration) {
9292
String bidResponse = adConfiguration.getBidResponse();
9393
initializeFyberClasses(adConfiguration);
94-
rewardedSpot.loadAd(bidResponse);
94+
String watermark = adConfiguration.getWatermark();
95+
rewardedSpot.loadAd(bidResponse, watermark);
9596
}
9697

9798
private void initializeFyberClasses(MediationRewardedAdConfiguration adConfiguration) {

ThirdPartyAdapters/dtexchange/dtexchange/src/test/kotlin/com/google/ads/mediation/fyber/DTExchangeBannerAdTest.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.fyber.inneractive.sdk.external.InneractiveAdViewUnitController
1010
import com.fyber.inneractive.sdk.external.InneractiveErrorCode
1111
import com.google.ads.mediation.adaptertestkit.AdErrorMatcher
1212
import com.google.ads.mediation.adaptertestkit.AdapterTestKitConstants.TEST_BID_RESPONSE
13+
import com.google.ads.mediation.adaptertestkit.AdapterTestKitConstants.TEST_WATERMARK
1314
import com.google.ads.mediation.adaptertestkit.createMediationBannerAdConfiguration
1415
import com.google.android.gms.ads.AdError
1516
import com.google.android.gms.ads.mediation.MediationAdLoadCallback
@@ -45,7 +46,13 @@ class DTExchangeBannerAdTest {
4546

4647
@Before
4748
fun setUp() {
48-
dtExchangeBannerAd = DTExchangeBannerAd(mockAdLoadCallback)
49+
val adConfiguration =
50+
createMediationBannerAdConfiguration(
51+
context = context,
52+
bidResponse = TEST_BID_RESPONSE,
53+
watermark = TEST_WATERMARK,
54+
)
55+
dtExchangeBannerAd = DTExchangeBannerAd(adConfiguration, mockAdLoadCallback)
4956
}
5057

5158
@Test

ThirdPartyAdapters/dtexchange/dtexchange/src/test/kotlin/com/google/ads/mediation/fyber/FyberMediationAdapterTest.kt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.fyber.inneractive.sdk.external.OnFyberMarketplaceInitializedListener.
2626
import com.google.ads.mediation.adaptertestkit.AdErrorMatcher
2727
import com.google.ads.mediation.adaptertestkit.AdapterTestKitConstants
2828
import com.google.ads.mediation.adaptertestkit.AdapterTestKitConstants.TEST_BID_RESPONSE
29+
import com.google.ads.mediation.adaptertestkit.AdapterTestKitConstants.TEST_WATERMARK
2930
import com.google.ads.mediation.adaptertestkit.assertGetSdkVersion
3031
import com.google.ads.mediation.adaptertestkit.assertGetVersionInfo
3132
import com.google.ads.mediation.adaptertestkit.createMediationBannerAdConfiguration
@@ -311,7 +312,11 @@ class FyberMediationAdapterTest {
311312
fun loadRtbBannerAd_invokesLoadAd() {
312313
mockStatic(InneractiveAdSpotManager::class.java).use {
313314
val bannerAdConfiguration =
314-
createMediationBannerAdConfiguration(context = activity, bidResponse = TEST_BID_RESPONSE)
315+
createMediationBannerAdConfiguration(
316+
context = activity,
317+
bidResponse = TEST_BID_RESPONSE,
318+
watermark = TEST_WATERMARK,
319+
)
315320
val mockAdSpot = mock<InneractiveAdSpot>()
316321
val mockInneractiveAdSpotManager =
317322
mock<InneractiveAdSpotManager> { on { createSpot() } doReturn mockAdSpot }
@@ -323,7 +328,7 @@ class FyberMediationAdapterTest {
323328
InneractiveAdManager.setMediationName(eq(FyberMediationAdapter.MEDIATOR_NAME))
324329
InneractiveAdManager.setMediationVersion(eq(MobileAds.getVersion().toString()))
325330
}
326-
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE))
331+
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE), eq(TEST_WATERMARK))
327332
}
328333
}
329334

@@ -337,6 +342,7 @@ class FyberMediationAdapterTest {
337342
createMediationInterstitialAdConfiguration(
338343
context = activity,
339344
bidResponse = TEST_BID_RESPONSE,
345+
watermark = TEST_WATERMARK,
340346
)
341347
val mockAdSpot = mock<InneractiveAdSpot>()
342348
val mockInneractiveAdSpotManager =
@@ -349,7 +355,7 @@ class FyberMediationAdapterTest {
349355
InneractiveAdManager.setMediationName(eq(FyberMediationAdapter.MEDIATOR_NAME))
350356
InneractiveAdManager.setMediationVersion(eq(MobileAds.getVersion().toString()))
351357
}
352-
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE))
358+
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE), eq(TEST_WATERMARK))
353359
}
354360
}
355361

@@ -439,7 +445,11 @@ class FyberMediationAdapterTest {
439445
fun loadRtbRewardedAd_invokesLoadAd() {
440446
mockStatic(InneractiveAdSpotManager::class.java).use {
441447
val rewardedAdParameters =
442-
createMediationRewardedAdConfiguration(context = activity, bidResponse = TEST_BID_RESPONSE)
448+
createMediationRewardedAdConfiguration(
449+
context = activity,
450+
bidResponse = TEST_BID_RESPONSE,
451+
watermark = TEST_WATERMARK,
452+
)
443453
val mockAdSpot = mock<InneractiveAdSpot>()
444454
val mockInneractiveAdSpotManager =
445455
mock<InneractiveAdSpotManager> { on { createSpot() } doReturn mockAdSpot }
@@ -451,7 +461,7 @@ class FyberMediationAdapterTest {
451461
InneractiveAdManager.setMediationName(eq(FyberMediationAdapter.MEDIATOR_NAME))
452462
InneractiveAdManager.setMediationVersion(eq(MobileAds.getVersion().toString()))
453463
}
454-
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE))
464+
verify(mockAdSpot).loadAd(eq(TEST_BID_RESPONSE), eq(TEST_WATERMARK))
455465
}
456466
}
457467

0 commit comments

Comments
 (0)