From 7962804dfd426d01df9720359506060f0e2bdbc9 Mon Sep 17 00:00:00 2001
From: MaksPetrukhnoPI <94057303+MaksPetrukhnoPI@users.noreply.github.com>
Date: Fri, 15 Apr 2022 13:19:14 +0300
Subject: [PATCH] Migration: Prebid Demo Kotlin to pbs on aws (#412)
* removed mopub dependencies from internal test app
* removed mopub dependencies from prebid demo kotlin
* removed mopub dependencies from internal test app android tests
* removed mopub declarations in manifest in demo apps
* removed mopub dependencies in prebid demo java
* removed mopub dependencies from prebid demo java tests
* removed al mopub references from demo apps and Dr.Prebid
* removed mopub dependencies from prebid mobile core
* removed mopub dependencies from prebid mobile core tests
* removed prebid mobile mopub adapters
* removed mopub adapters from scripts
* configured banner 320x50 in-app prebid demo kotlin
* configured in-app cases
* removed mopub cases
* configured gam cases
* configured admob cases
* added gam video interstitial example
* applied appropriate gam video interstitial
* added video base parameters for gam video interstitial ad unit
* configured ad unit for prebid banner 300x250
* removed setStoredAuctionResponse(null) function from ads creators
---
.../prebid/mobile/app/CustomApplication.java | 2 +
.../src/main/AndroidManifest.xml | 3 +-
.../prebidkotlindemo/AdTypesRepository.kt | 99 +++++++++++--------
.../mobile/prebidkotlindemo/DemoActivity.kt | 4 +-
.../mobile/prebidkotlindemo/ads/GamBanner.kt | 5 +-
.../prebidkotlindemo/ads/GamInterstitial.kt | 12 ++-
.../ads/GamVideoInterstitial.kt | 95 ++++++++++++++++++
.../prebidkotlindemo/ads/inapp/InAppBanner.kt | 12 ++-
.../ads/inapp/InAppInterstitial.kt | 17 +++-
.../ads/inapp/InAppRewardedInterstitial.kt | 4 +-
.../ads/inapp/InAppVideoBanner.kt | 11 ++-
.../ads/inapp/InAppVideoInterstitial.kt | 11 ++-
.../ads/inappadmob/InAppAdMobBanner.kt | 12 ++-
.../ads/inappadmob/InAppAdMobInterstitial.kt | 7 +-
.../ads/inappadmob/InAppAdMobNative.kt | 13 +--
.../ads/inappadmob/InAppAdMobRewarded.kt | 11 ++-
.../ads/inappgam/InAppGamBanner.kt | 13 ++-
.../ads/inappgam/InAppGamInterstitial.kt | 5 +-
.../inappgam/InAppGamRewardedInterstitial.kt | 9 +-
.../ads/inappgam/InAppGamVideoBanner.kt | 5 +-
.../ads/inappgam/InAppGamVideoInterstitial.kt | 4 +-
scripts/Maven/deployPrebidMobile.sh | 1 +
.../mobile/drprebid/validation/SdkTest.java | 6 ++
23 files changed, 288 insertions(+), 73 deletions(-)
create mode 100644 Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamVideoInterstitial.kt
diff --git a/Example/PrebidDemoJava/src/main/java/org/prebid/mobile/app/CustomApplication.java b/Example/PrebidDemoJava/src/main/java/org/prebid/mobile/app/CustomApplication.java
index 0d5aa7a8a..b417196c0 100644
--- a/Example/PrebidDemoJava/src/main/java/org/prebid/mobile/app/CustomApplication.java
+++ b/Example/PrebidDemoJava/src/main/java/org/prebid/mobile/app/CustomApplication.java
@@ -20,6 +20,7 @@
import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
+
import org.prebid.mobile.PrebidMobile;
import static android.view.WindowManager.LayoutParams.*;
@@ -28,6 +29,7 @@ public class CustomApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
+
//set Prebid Mobile global Settings
//region PrebidMobile API
diff --git a/Example/PrebidDemoKotlin/src/main/AndroidManifest.xml b/Example/PrebidDemoKotlin/src/main/AndroidManifest.xml
index 18097a249..4e617b452 100644
--- a/Example/PrebidDemoKotlin/src/main/AndroidManifest.xml
+++ b/Example/PrebidDemoKotlin/src/main/AndroidManifest.xml
@@ -41,6 +41,7 @@
+
-
\ No newline at end of file
+
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/AdTypesRepository.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/AdTypesRepository.kt
index 2ad49c7e5..7f604d358 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/AdTypesRepository.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/AdTypesRepository.kt
@@ -4,6 +4,8 @@ import org.prebid.mobile.Host
import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.prebidkotlindemo.ads.GamBanner
import org.prebid.mobile.prebidkotlindemo.ads.GamInterstitial
+import org.prebid.mobile.prebidkotlindemo.ads.GamVideoInterstitial
+
import org.prebid.mobile.prebidkotlindemo.ads.inapp.*
import org.prebid.mobile.prebidkotlindemo.ads.inappadmob.InAppAdMobBanner
import org.prebid.mobile.prebidkotlindemo.ads.inappadmob.InAppAdMobInterstitial
@@ -21,14 +23,13 @@ object AdTypesRepository {
AdType(
"Banner 320x50",
onCreate = { _, wrapper, autoRefreshTime ->
- useTestServer()
- PrebidMobile.setStoredAuctionResponse("response-prebid-banner-320-50")
GamBanner.create(
wrapper, autoRefreshTime,
320, 50,
// TODO: Problem with ids
- "/5300653/pavliuchyk_test_adunit_1x1_puc",
- "imp-prebid-banner-320-50"
+ "/21808260008/prebid_demo_app_original_api_banner",
+ "imp-prebid-banner-320-50",
+ "response-prebid-banner-320-50"
)
},
onDestroy = { GamBanner.destroy() }
@@ -36,30 +37,44 @@ object AdTypesRepository {
AdType(
"Banner 300x250",
onCreate = { _, wrapper, autoRefreshTime ->
- useAppNexusServer()
GamBanner.create(
wrapper, autoRefreshTime,
300, 250,
- "/5300653/pavliuchyk_test_adunit_1x1_puc",
- "6ace8c7d-88c0-4623-8117-75bc3f0a2e45"
+ "/21808260008/prebid_demo_app_original_api_banner_300x250_order",
+ "imp-prebid-banner-300-250",
+ "response-prebid-banner-300-250"
)
},
onDestroy = { GamBanner.destroy() }
),
AdType(
- "Interstitial",
+ "Display Interstitial",
onCreate = { activity, _, autoRefreshTime ->
- useAppNexusServer()
GamInterstitial.create(
activity, autoRefreshTime,
// TODO: Problem with ids
- "/5300653/pavliuchyk_test_adunit_1x1_puc",
- "625c6125-f19e-4d5b-95c5-55501526b2a4"
+ "/21808260008/prebid-demo-app-original-api-display-interstitial",
+ "imp-prebid-display-interstitial-320-480",
+ "response-prebid-display-interstitial-320-480"
+ )
+ },
+ onDestroy = { GamInterstitial.destroy() }
+ ),
+ AdType(
+ "Video Interstitial",
+ onCreate = { activity, _, _ ->
+ GamVideoInterstitial.create(
+ activity,
+ "/21808260008/prebid-demo-app-original-api-video-interstitial",
+ "imp-prebid-video-interstitial-320-480",
+ "response-prebid-video-interstitial-320-480"
)
},
onDestroy = { GamInterstitial.destroy() }
)
),
+
+
"In-App" to listOf(
AdType(
"Banner 320x50",
@@ -67,7 +82,8 @@ object AdTypesRepository {
InAppBanner.create(
wrapper, autoRefreshTime / 1000,
320, 50,
- "50699c03-0910-477c-b4a4-911dbe2b9d42"
+ "imp-prebid-banner-320-50",
+ "response-prebid-banner-320-50"
)
},
onDestroy = { InAppBanner.destroy() }
@@ -78,7 +94,8 @@ object AdTypesRepository {
InAppInterstitial.create(
context,
30, 30,
- "5a4b8dcf-f984-4b04-9448-6529908d6cb6"
+ "imp-prebid-display-interstitial-320-480",
+ "response-prebid-display-interstitial-320-480"
)
},
onDestroy = { InAppInterstitial.destroy() }
@@ -89,7 +106,8 @@ object AdTypesRepository {
InAppVideoBanner.create(
wrapper, autoRefreshTime / 1000,
300, 250,
- "9007b76d-c73c-49c6-b0a8-1c7890a84b33"
+ "imp-prebid-video-outstream",
+ "response-prebid-video-outstream"
)
},
onDestroy = { InAppVideoBanner.destroy() }
@@ -99,7 +117,8 @@ object AdTypesRepository {
onCreate = { context, _, _ ->
InAppVideoInterstitial.create(
context,
- "12f58bc2-b664-4672-8d19-638bcc96fd5c"
+ "imp-prebid-video-interstitial-320-480",
+ "response-prebid-video-interstitial-320-480"
)
},
onDestroy = { InAppVideoInterstitial.destroy() }
@@ -109,7 +128,8 @@ object AdTypesRepository {
onCreate = { context, _, _ ->
InAppRewardedInterstitial.create(
context,
- "12f58bc2-b664-4672-8d19-638bcc96fd5c"
+ "imp-prebid-video-rewarded-320-480",
+ "response-prebid-video-rewarded-320-480"
)
},
onDestroy = { InAppRewardedInterstitial.destroy() }
@@ -124,7 +144,8 @@ object AdTypesRepository {
wrapper, autoRefreshTime / 1000,
320, 50,
"/21808260008/prebid_oxb_320x50_banner",
- "50699c03-0910-477c-b4a4-911dbe2b9d42"
+ "imp-prebid-banner-320-50",
+ "response-prebid-banner-320-50"
)
},
onDestroy = { InAppGamBanner.destroy() }
@@ -136,7 +157,8 @@ object AdTypesRepository {
context,
30, 30,
"/21808260008/prebid_oxb_html_interstitial",
- "5a4b8dcf-f984-4b04-9448-6529908d6cb6"
+ "imp-prebid-display-interstitial-320-480",
+ "response-prebid-display-interstitial-320-480"
)
},
onDestroy = { InAppGamInterstitial.destroy() }
@@ -148,7 +170,8 @@ object AdTypesRepository {
wrapper, autoRefreshTime / 1000,
300, 250,
"/21808260008/prebid_oxb_300x250_banner",
- "9007b76d-c73c-49c6-b0a8-1c7890a84b33"
+ "imp-prebid-video-outstream",
+ "response-prebid-video-outstream"
)
},
onDestroy = { InAppGamVideoBanner.destroy() }
@@ -158,8 +181,9 @@ object AdTypesRepository {
onCreate = { activity, _, _ ->
InAppGamVideoInterstitial.create(
activity,
- "/21808260008/prebid_oxb_320x480_interstitial_video_static",
- "28259226-68de-49f8-88d6-f0f2fab846e3"
+ "/21808260008/prebid-demo-app-original-api-video-interstitial",
+ "imp-prebid-video-interstitial-320-480",
+ "response-prebid-video-interstitial-320-480"
)
},
onDestroy = { InAppGamVideoInterstitial.destroy() }
@@ -170,7 +194,8 @@ object AdTypesRepository {
InAppGamRewardedInterstitial.create(
activity,
"/21808260008/prebid_oxb_rewarded_video_test",
- "12f58bc2-b664-4672-8d19-638bcc96fd5c"
+ "imp-prebid-video-rewarded-320-480",
+ "response-prebid-video-rewarded-320-480"
)
},
onDestroy = { InAppGamRewardedInterstitial.destroy() }
@@ -185,7 +210,8 @@ object AdTypesRepository {
activity, wrapper, autoRefreshTime,
320, 50,
"ca-app-pub-1875909575462531/3793078260",
- "50699c03-0910-477c-b4a4-911dbe2b9d42"
+ "imp-prebid-banner-320-50",
+ "response-prebid-banner-320-50"
)
},
onDestroy = { InAppAdMobBanner.destroy() }
@@ -196,8 +222,9 @@ object AdTypesRepository {
InAppAdMobInterstitial.create(
activity,
"ca-app-pub-1875909575462531/6393291067",
- "5a4b8dcf-f984-4b04-9448-6529908d6cb6",
- EnumSet.of(AdUnitFormat.DISPLAY)
+ "imp-prebid-display-interstitial-320-480",
+ EnumSet.of(AdUnitFormat.DISPLAY),
+ "response-prebid-display-interstitial-320-480"
)
},
onDestroy = { InAppAdMobInterstitial.destroy() }
@@ -208,8 +235,9 @@ object AdTypesRepository {
InAppAdMobInterstitial.create(
activity,
"ca-app-pub-1875909575462531/6393291067",
- "12f58bc2-b664-4672-8d19-638bcc96fd5c",
- EnumSet.of(AdUnitFormat.VIDEO)
+ "imp-prebid-video-interstitial-320-480",
+ EnumSet.of(AdUnitFormat.VIDEO),"" +
+ "response-prebid-video-interstitial-320-480"
)
},
onDestroy = { InAppAdMobInterstitial.destroy() }
@@ -220,7 +248,8 @@ object AdTypesRepository {
InAppAdMobRewarded.create(
activity,
"ca-app-pub-1875909575462531/1908212572",
- "9007b76d-c73c-49c6-b0a8-1c7890a84b33"
+ "imp-prebid-video-rewarded-320-480",
+ "response-prebid-video-rewarded-320-480"
)
},
onDestroy = { InAppAdMobRewarded.destroy() }
@@ -232,7 +261,8 @@ object AdTypesRepository {
InAppAdMobNative.create(
wrapper,
"ca-app-pub-1875909575462531/9720985924",
- "51fe68ba-aff2-401e-9e15-f3ed89d5c036"
+ "imp-prebid-banner-native-styles",
+ "response-prebid-banner-native-styles"
)
},
onDestroy = {
@@ -242,19 +272,10 @@ object AdTypesRepository {
)
)
- fun useOpenXServer() {
- PrebidMobile.setPrebidServerAccountId("0689a263-318d-448b-a3d4-b02e8a709d9d")
- PrebidMobile.setPrebidServerHost(Host.createCustomHost("https://prebid.openx.net/openrtb2/auction"))
- }
-
- private fun useTestServer() {
+ fun usePrebidServer() {
PrebidMobile.setPrebidServerAccountId("0689a263-318d-448b-a3d4-b02e8a709d9d")
PrebidMobile.setPrebidServerHost(Host.createCustomHost("https://prebid-server-test-j.prebid.org/openrtb2/auction"))
}
- private fun useAppNexusServer() {
- PrebidMobile.setPrebidServerAccountId("bfa84af2-bd16-4d35-96ad-31c6bb888df0")
- PrebidMobile.setPrebidServerHost(Host.APPNEXUS)
- }
}
\ No newline at end of file
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/DemoActivity.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/DemoActivity.kt
index 3995d995f..c6cb3d239 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/DemoActivity.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/DemoActivity.kt
@@ -21,6 +21,7 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.preference.PreferenceManager
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.prebidkotlindemo.databinding.ActivityDemoBinding
class DemoActivity : AppCompatActivity() {
@@ -55,7 +56,7 @@ class DemoActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_demo)
- AdTypesRepository.useOpenXServer()
+ AdTypesRepository.usePrebidServer()
useFakeGDPR()
parseArguments()
initViews()
@@ -65,6 +66,7 @@ class DemoActivity : AppCompatActivity() {
override fun onDestroy() {
super.onDestroy()
currentAdType.onDestroy?.let { it() }
+ PrebidMobile.setStoredAuctionResponse(null)
}
private fun parseArguments() {
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamBanner.kt
index cb61bf174..cf9a2562a 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamBanner.kt
@@ -10,6 +10,7 @@ import com.google.android.gms.ads.admanager.AdManagerAdRequest
import com.google.android.gms.ads.admanager.AdManagerAdView
import org.prebid.mobile.AdUnit
import org.prebid.mobile.BannerAdUnit
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.addendum.AdViewUtils
import org.prebid.mobile.addendum.PbFindSizeError
@@ -25,10 +26,12 @@ object GamBanner {
width: Int,
height: Int,
adUnitId: String,
- configId: String
+ configId: String,
+ storedAuctionResponse: String
) {
val adView = AdManagerAdView(wrapper.context)
adView.adUnitId = adUnitId
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adView.adListener = object : AdListener() {
override fun onAdLoaded() {
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamInterstitial.kt
index 9f6ea1d6e..d65794511 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamInterstitial.kt
@@ -10,6 +10,7 @@ import com.google.android.gms.ads.admanager.AdManagerInterstitialAd
import com.google.android.gms.ads.admanager.AdManagerInterstitialAdLoadCallback
import org.prebid.mobile.AdUnit
import org.prebid.mobile.InterstitialAdUnit
+import org.prebid.mobile.PrebidMobile
object GamInterstitial {
@@ -17,9 +18,17 @@ object GamInterstitial {
private var adUnit: AdUnit? = null
- fun create(activity: Activity, autoRefreshTime: Int, adUnitId: String, configId: String) {
+ fun create(
+ activity: Activity,
+ autoRefreshTime: Int,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
val requestBuilder = AdManagerAdRequest.Builder()
val request = requestBuilder.build()
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
+
adUnit = InterstitialAdUnit(configId)
adUnit?.setAutoRefreshPeriodMillis(autoRefreshTime)
adUnit?.fetchDemand(request) { resultCode ->
@@ -56,6 +65,7 @@ object GamInterstitial {
fun destroy() {
adUnit?.stopAutoRefresh()
+
adUnit = null
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamVideoInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamVideoInterstitial.kt
new file mode 100644
index 000000000..74decdbf9
--- /dev/null
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/GamVideoInterstitial.kt
@@ -0,0 +1,95 @@
+package org.prebid.mobile.prebidkotlindemo.ads
+
+import android.R
+import android.app.Activity
+import android.os.Build
+import android.util.Log
+import androidx.appcompat.app.AlertDialog
+import com.google.android.gms.ads.LoadAdError
+import com.google.android.gms.ads.admanager.AdManagerAdRequest
+import com.google.android.gms.ads.admanager.AdManagerInterstitialAd
+import com.google.android.gms.ads.admanager.AdManagerInterstitialAdLoadCallback
+import org.prebid.mobile.*
+
+
+object GamVideoInterstitial {
+ private val TAG = GamVideoInterstitial::class.java.simpleName
+
+ private var adUnit: AdUnit? = null
+// private var amInterstitial: PublisherInterstitialAd? = null
+
+ fun create(
+ activity: Activity,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
+ val request = AdManagerAdRequest.Builder().build()
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
+
+ val videoInterstitialAdUnit = VideoInterstitialAdUnit(configId)
+ val parameters = VideoBaseAdUnit.Parameters().apply {
+ placement = Signals.Placement.Interstitial
+ api = listOf(
+ Signals.Api.VPAID_1,
+ Signals.Api.VPAID_2
+ )
+ maxBitrate = 1500
+ minBitrate = 300
+ maxDuration = 30
+ minDuration = 5
+ mimes = listOf("video/x-flv", "video/mp4")
+ playbackMethod = listOf(Signals.PlaybackMethod.AutoPlaySoundOn)
+ protocols = listOf(
+ Signals.Protocols.VAST_2_0
+ )
+ }
+ videoInterstitialAdUnit.parameters = parameters
+ adUnit = videoInterstitialAdUnit
+ adUnit?.fetchDemand(request) { resultCode ->
+ Log.d(TAG, "Result code: $resultCode")
+ loadAd(activity, adUnitId, request)
+ }
+
+ }
+
+ private fun loadAd(
+ activity: Activity,
+ adUnitId: String,
+ request: AdManagerAdRequest
+ ) {
+ val adLoadCallback = object : AdManagerInterstitialAdLoadCallback() {
+ override fun onAdLoaded(rewardedInterstitialAd: AdManagerInterstitialAd) {
+ super.onAdLoaded(rewardedInterstitialAd)
+ rewardedInterstitialAd.show(activity)
+ }
+
+ override fun onAdFailedToLoad(loadAdError: LoadAdError) {
+ super.onAdFailedToLoad(loadAdError)
+
+ val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ AlertDialog.Builder(activity, R.style.Theme_Material_Dialog_Alert)
+ } else {
+ AlertDialog.Builder(activity)
+ }
+ Log.d(TAG, "onAdFailedToLoad: $loadAdError")
+ builder.setTitle("Failed to load DFP interstitial ad")
+ .setMessage("Error: $loadAdError")
+ .setIcon(R.drawable.ic_dialog_alert)
+ .show()
+ }
+ }
+
+
+ AdManagerInterstitialAd.load(
+ activity,
+ adUnitId,
+ request,
+ adLoadCallback
+ )
+ }
+
+ fun destroy() {
+ adUnit = null
+ }
+}
\ No newline at end of file
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppBanner.kt
index 866505da6..18cd950af 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppBanner.kt
@@ -2,20 +2,28 @@ package org.prebid.mobile.prebidkotlindemo.ads.inapp
import android.view.ViewGroup
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.rendering.bidding.parallel.BannerView
object InAppBanner {
private var adView: BannerView? = null
- fun create(wrapper: ViewGroup, autoRefreshTime: Int, width: Int, height: Int, configId: String) {
+ fun create(
+ wrapper: ViewGroup,
+ autoRefreshTime: Int,
+ width: Int,
+ height: Int,
+ configId: String,
+ storedAuctionResponse:String
+ ) {
adView = BannerView(
wrapper.context,
configId,
AdSize(width, height)
)
wrapper.addView(adView)
-
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adView?.setAutoRefreshDelay(autoRefreshTime)
adView?.loadAd()
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppInterstitial.kt
index b390f3e28..97f232bae 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppInterstitial.kt
@@ -2,6 +2,7 @@ package org.prebid.mobile.prebidkotlindemo.ads.inapp
import android.content.Context
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.rendering.bidding.listeners.InterstitialAdUnitListener
import org.prebid.mobile.rendering.bidding.parallel.InterstitialAdUnit
import org.prebid.mobile.rendering.errors.AdException
@@ -10,8 +11,15 @@ object InAppInterstitial {
private var adUnit: InterstitialAdUnit? = null
- fun create(context: Context, minPercentageWidth: Int, minPercentageHeight: Int, configId: String) {
+ fun create(
+ context: Context,
+ minPercentageWidth: Int,
+ minPercentageHeight: Int,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
adUnit = InterstitialAdUnit(context, configId)
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit?.setMinSizePercentage(AdSize(minPercentageWidth, minPercentageHeight))
adUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
@@ -19,7 +27,12 @@ object InAppInterstitial {
}
override fun onAdDisplayed(interstitialAdUnit: InterstitialAdUnit?) {}
- override fun onAdFailed(interstitialAdUnit: InterstitialAdUnit?, exception: AdException?) {}
+ override fun onAdFailed(
+ interstitialAdUnit: InterstitialAdUnit?,
+ exception: AdException?
+ ) {
+ }
+
override fun onAdClicked(interstitialAdUnit: InterstitialAdUnit?) {}
override fun onAdClosed(interstitialAdUnit: InterstitialAdUnit?) {}
})
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppRewardedInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppRewardedInterstitial.kt
index 65ffa67c3..2c115de27 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppRewardedInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppRewardedInterstitial.kt
@@ -1,6 +1,7 @@
package org.prebid.mobile.prebidkotlindemo.ads.inapp
import android.content.Context
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.rendering.bidding.listeners.RewardedAdUnitListener
import org.prebid.mobile.rendering.bidding.parallel.RewardedAdUnit
import org.prebid.mobile.rendering.errors.AdException
@@ -9,8 +10,9 @@ object InAppRewardedInterstitial {
private var adUnit: RewardedAdUnit? = null
- fun create(context: Context, configId: String) {
+ fun create(context: Context, configId: String,storedAuctionResponse:String) {
adUnit = RewardedAdUnit(context, configId)
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit?.setRewardedAdUnitListener(object : RewardedAdUnitListener {
override fun onAdLoaded(rewardedAdUnit: RewardedAdUnit?) {
adUnit?.show()
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoBanner.kt
index b13fb9e93..a4dc10298 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoBanner.kt
@@ -2,6 +2,7 @@ package org.prebid.mobile.prebidkotlindemo.ads.inapp
import android.view.ViewGroup
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.rendering.bidding.enums.VideoPlacementType
import org.prebid.mobile.rendering.bidding.parallel.BannerView
@@ -9,9 +10,17 @@ object InAppVideoBanner {
private var bannerView: BannerView? = null
- fun create(wrapper: ViewGroup, autoRefreshTime: Int, width: Int, height: Int, configId: String) {
+ fun create(
+ wrapper: ViewGroup,
+ autoRefreshTime: Int,
+ width: Int,
+ height: Int,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
bannerView = BannerView(wrapper.context, configId, AdSize(width, height))
wrapper.addView(bannerView)
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
bannerView?.videoPlacementType = VideoPlacementType.IN_BANNER
bannerView?.setAutoRefreshDelay(autoRefreshTime)
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoInterstitial.kt
index 1b4bab79e..d7245dbc3 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inapp/InAppVideoInterstitial.kt
@@ -1,6 +1,7 @@
package org.prebid.mobile.prebidkotlindemo.ads.inapp
import android.content.Context
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.rendering.bidding.enums.AdUnitFormat
import org.prebid.mobile.rendering.bidding.listeners.InterstitialAdUnitListener
import org.prebid.mobile.rendering.bidding.parallel.InterstitialAdUnit
@@ -11,15 +12,21 @@ object InAppVideoInterstitial {
private var adUnit: InterstitialAdUnit? = null
- fun create(context: Context, configId: String) {
+ fun create(context: Context, configId: String, storedAuctionResponse: String) {
adUnit = InterstitialAdUnit(context, configId, EnumSet.of(AdUnitFormat.VIDEO))
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
adUnit?.show()
}
override fun onAdDisplayed(interstitialAdUnit: InterstitialAdUnit?) {}
- override fun onAdFailed(interstitialAdUnit: InterstitialAdUnit?, exception: AdException?) {}
+ override fun onAdFailed(
+ interstitialAdUnit: InterstitialAdUnit?,
+ exception: AdException?
+ ) {
+ }
+
override fun onAdClicked(interstitialAdUnit: InterstitialAdUnit?) {}
override fun onAdClosed(interstitialAdUnit: InterstitialAdUnit?) {}
})
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobBanner.kt
index 76a2ec722..62db31de0 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobBanner.kt
@@ -6,6 +6,7 @@ import android.util.Log
import android.view.ViewGroup
import com.google.android.gms.ads.*
import com.google.android.gms.ads.initialization.InitializationStatus
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.admob.AdMobBannerMediationUtils
import org.prebid.mobile.admob.PrebidBannerAdapter
import org.prebid.mobile.rendering.bidding.display.MediationBannerAdUnit
@@ -24,20 +25,24 @@ object InAppAdMobBanner {
width: Int,
height: Int,
adUnitId: String,
- configId: String
+ configId: String,
+ storedAuctionResponse: String
) {
MobileAds.initialize(wrapper.context) { status ->
Log.d("MobileAds", "Initialization complete.")
logAdaptersInitializationStatus(status)
}
-
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
/** Google recommends put activity for mediation ad networks */
bannerView = AdView(activity)
bannerView?.adSize = AdSize.BANNER
bannerView?.adUnitId = adUnitId
bannerView?.adListener = object : AdListener() {
override fun onAdLoaded() {
- Log.d("AdListener", "Won ad network: ${bannerView?.responseInfo?.mediationAdapterClassName}")
+ Log.d(
+ "AdListener",
+ "Won ad network: ${bannerView?.responseInfo?.mediationAdapterClassName}"
+ )
}
override fun onAdFailedToLoad(p0: LoadAdError) {
@@ -69,7 +74,6 @@ object InAppAdMobBanner {
fun destroy() {
bannerView?.destroy()
bannerView = null
-
adUnit?.destroy()
adUnit = null
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobInterstitial.kt
index 0f27c15b9..964a39d10 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobInterstitial.kt
@@ -7,6 +7,7 @@ import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.LoadAdError
import com.google.android.gms.ads.interstitial.InterstitialAd
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.admob.AdMobInterstitialMediationUtils
import org.prebid.mobile.admob.PrebidInterstitialAdapter
import org.prebid.mobile.rendering.bidding.display.MediationInterstitialAdUnit
@@ -22,7 +23,8 @@ object InAppAdMobInterstitial {
activity: Activity,
adUnitId: String,
configId: String,
- adUnitFormats: EnumSet
+ adUnitFormats: EnumSet,
+ storedAuctionResponse: String
) {
val extras = Bundle()
val request = AdRequest
@@ -30,7 +32,7 @@ object InAppAdMobInterstitial {
.addCustomEventExtrasBundle(PrebidInterstitialAdapter::class.java, extras)
.build()
val mediationUtils = AdMobInterstitialMediationUtils(extras)
-
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit = MediationInterstitialAdUnit(
activity,
configId,
@@ -56,7 +58,6 @@ object InAppAdMobInterstitial {
fun destroy() {
adUnit?.destroy()
adUnit = null
-
interstitialAd = null
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobNative.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobNative.kt
index 1a234d921..b23b6073e 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobNative.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobNative.kt
@@ -19,12 +19,13 @@ object InAppAdMobNative {
private var nativeAd: NativeAd? = null
- fun create(wrapper: ViewGroup, adUnitId: String, configId: String) {
- val host = Host.CUSTOM
- host.hostUrl = "https://prebid.qa.openx.net/openrtb2/auction"
- PrebidMobile.setPrebidServerHost(host)
- PrebidMobile.setPrebidServerAccountId("08efa38c-b6b4-48c4-adc0-bcb791caa791")
-
+ fun create(
+ wrapper: ViewGroup,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
val nativeAdOptions = NativeAdOptions
.Builder()
.build()
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobRewarded.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobRewarded.kt
index df1466969..c9077a830 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobRewarded.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappadmob/InAppAdMobRewarded.kt
@@ -7,6 +7,7 @@ import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.LoadAdError
import com.google.android.gms.ads.rewarded.RewardedAd
import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.admob.AdMobRewardedMediationUtils
import org.prebid.mobile.admob.PrebidRewardedAdapter
import org.prebid.mobile.rendering.bidding.display.MediationRewardedVideoAdUnit
@@ -17,14 +18,19 @@ object InAppAdMobRewarded {
private var rewardedAd: RewardedAd? = null
private var adUnit: MediationRewardedVideoAdUnit? = null
- fun create(activity: Activity, adUnitId: String, configId: String) {
+ fun create(
+ activity: Activity,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
val extras = Bundle()
val request = AdRequest
.Builder()
.addNetworkExtrasBundle(PrebidRewardedAdapter::class.java, extras)
.build()
val mediationUtils = AdMobRewardedMediationUtils(extras)
-
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit = MediationRewardedVideoAdUnit(activity, configId, mediationUtils)
adUnit?.fetchDemand { result ->
Log.d("Prebid", "Fetch demand result: $result")
@@ -52,7 +58,6 @@ object InAppAdMobRewarded {
fun destroy() {
rewardedAd = null
-
adUnit?.destroy()
adUnit = null
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamBanner.kt
index d2be71c98..837ac3c86 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamBanner.kt
@@ -2,6 +2,7 @@ package org.prebid.mobile.prebidkotlindemo.ads.inappgam
import android.view.ViewGroup
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.eventhandlers.GamBannerEventHandler
import org.prebid.mobile.rendering.bidding.parallel.BannerView
@@ -9,11 +10,19 @@ object InAppGamBanner {
private var adView: BannerView? = null
- fun create(wrapper: ViewGroup, autoRefreshTime: Int, width: Int, height: Int, adUnitId: String, configId: String) {
+ fun create(
+ wrapper: ViewGroup,
+ autoRefreshTime: Int,
+ width: Int,
+ height: Int,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
val eventHandler = GamBannerEventHandler(wrapper.context, adUnitId, AdSize(width, height))
adView = BannerView(wrapper.context, configId, eventHandler)
wrapper.addView(adView)
-
adView?.setAutoRefreshDelay(autoRefreshTime)
adView?.loadAd()
}
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamInterstitial.kt
index 5db50bda8..0a66fd541 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamInterstitial.kt
@@ -2,6 +2,7 @@ package org.prebid.mobile.prebidkotlindemo.ads.inappgam
import android.app.Activity
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.eventhandlers.GamInterstitialEventHandler
import org.prebid.mobile.rendering.bidding.listeners.InterstitialAdUnitListener
import org.prebid.mobile.rendering.bidding.parallel.InterstitialAdUnit
@@ -16,10 +17,12 @@ object InAppGamInterstitial {
minPercentageWidth: Int,
minPercentageHeight: Int,
adUnitId: String,
- configId: String
+ configId: String,
+ storedAuctionResponse: String
) {
val eventHandler = GamInterstitialEventHandler(activity, adUnitId)
adUnit = InterstitialAdUnit(activity, configId, eventHandler)
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
adUnit?.setMinSizePercentage(AdSize(minPercentageWidth, minPercentageHeight))
adUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamRewardedInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamRewardedInterstitial.kt
index 5605a622e..b99187435 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamRewardedInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamRewardedInterstitial.kt
@@ -1,6 +1,7 @@
package org.prebid.mobile.prebidkotlindemo.ads.inappgam
import android.app.Activity
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.eventhandlers.GamRewardedEventHandler
import org.prebid.mobile.rendering.bidding.listeners.RewardedAdUnitListener
import org.prebid.mobile.rendering.bidding.parallel.RewardedAdUnit
@@ -10,7 +11,13 @@ object InAppGamRewardedInterstitial {
private var adUnit: RewardedAdUnit? = null
- fun create(activity: Activity, adUnitId: String, configId: String) {
+ fun create(
+ activity: Activity,
+ adUnitId: String,
+ configId: String,
+ storedAuctionResponse: String
+ ) {
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
val eventHandler = GamRewardedEventHandler(activity, adUnitId)
adUnit = RewardedAdUnit(activity, configId, eventHandler)
adUnit?.setRewardedAdUnitListener(object : RewardedAdUnitListener {
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoBanner.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoBanner.kt
index 7b637d1c6..63321a39c 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoBanner.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoBanner.kt
@@ -2,6 +2,7 @@ package org.prebid.mobile.prebidkotlindemo.ads.inappgam
import android.view.ViewGroup
import org.prebid.mobile.AdSize
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.eventhandlers.GamBannerEventHandler
import org.prebid.mobile.rendering.bidding.enums.VideoPlacementType
import org.prebid.mobile.rendering.bidding.parallel.BannerView
@@ -16,9 +17,11 @@ object InAppGamVideoBanner {
width: Int,
height: Int,
adUnitId: String,
- configId: String
+ configId: String,
+ storedAuctionResponse: String
) {
val eventHandler = GamBannerEventHandler(wrapper.context, adUnitId, AdSize(width, height))
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
bannerView = BannerView(wrapper.context, configId, eventHandler)
bannerView?.videoPlacementType = VideoPlacementType.IN_BANNER
diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoInterstitial.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoInterstitial.kt
index e0dfb4007..3554f4e4b 100644
--- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoInterstitial.kt
+++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/ads/inappgam/InAppGamVideoInterstitial.kt
@@ -1,6 +1,7 @@
package org.prebid.mobile.prebidkotlindemo.ads.inappgam
import android.app.Activity
+import org.prebid.mobile.PrebidMobile
import org.prebid.mobile.eventhandlers.GamInterstitialEventHandler
import org.prebid.mobile.rendering.bidding.enums.AdUnitFormat
import org.prebid.mobile.rendering.bidding.listeners.InterstitialAdUnitListener
@@ -12,7 +13,8 @@ object InAppGamVideoInterstitial {
private var adUnit: InterstitialAdUnit? = null
- fun create(activity: Activity, adUnitId: String, configId: String) {
+ fun create(activity: Activity, adUnitId: String, configId: String,storedAuctionResponse: String) {
+ PrebidMobile.setStoredAuctionResponse(storedAuctionResponse)
val eventHandler = GamInterstitialEventHandler(activity, adUnitId)
adUnit = InterstitialAdUnit(activity, configId, EnumSet.of(AdUnitFormat.VIDEO), eventHandler)
adUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
diff --git a/scripts/Maven/deployPrebidMobile.sh b/scripts/Maven/deployPrebidMobile.sh
index 8aca83020..5a6634e0f 100755
--- a/scripts/Maven/deployPrebidMobile.sh
+++ b/scripts/Maven/deployPrebidMobile.sh
@@ -41,6 +41,7 @@ sh ./buildPrebidMobile.sh
cp -r ../generated/* "$DEPLOY_DIR_ABSOLUTE" || true
modules=("PrebidMobile" "PrebidMobile-core" "PrebidMobile-gamEventHandlers" "PrebidMobile-admobAdapters")
+
extensions=("jar" "aar" "jar" "jar")
for n in ${!modules[@]}; do
echo -e "\n"
diff --git a/tools/drprebid/src/main/java/org/prebid/mobile/drprebid/validation/SdkTest.java b/tools/drprebid/src/main/java/org/prebid/mobile/drprebid/validation/SdkTest.java
index 330d24dbc..6ff9561da 100644
--- a/tools/drprebid/src/main/java/org/prebid/mobile/drprebid/validation/SdkTest.java
+++ b/tools/drprebid/src/main/java/org/prebid/mobile/drprebid/validation/SdkTest.java
@@ -1,13 +1,17 @@
package org.prebid.mobile.drprebid.validation;
+import static org.prebid.mobile.ResultCode.SUCCESS;
+
import android.app.Activity;
import android.net.Uri;
import android.text.TextUtils;
+
import androidx.annotation.Nullable;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.doubleclick.PublisherAdRequest;
import com.google.android.gms.ads.doubleclick.PublisherAdView;
import com.google.android.gms.ads.doubleclick.PublisherInterstitialAd;
+
import org.prebid.mobile.*;
import org.prebid.mobile.drprebid.managers.SettingsManager;
import org.prebid.mobile.drprebid.model.AdSize;
@@ -17,6 +21,7 @@
import java.util.HashMap;
import java.util.Map;
+
import static org.prebid.mobile.ResultCode.SUCCESS;
public class SdkTest {
@@ -248,6 +253,7 @@ public void onAdFailedToLoad(int errorCode) {
};
+
private void checkResponseForPrebidCreative() {
if (!TextUtils.isEmpty(mAdServerResponse) && (mAdServerResponse.contains("pbm.js") || mAdServerResponse.contains("creative.js"))) {
invokeContainsPrebidCreative(true);