diff --git a/build.gradle b/build.gradle index 80b155e..8808d4a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.cas_version = '3.2.3' - ext.kotlin_version = '1.8.20' + ext.cas_version = '3.2.4' + ext.kotlin_version = '1.8.22' repositories { google() mavenCentral() diff --git a/javaSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.java b/javaSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.java index d4404a7..324217d 100644 --- a/javaSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.java +++ b/javaSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.java @@ -24,19 +24,23 @@ public void onCreate() { //CAS.settings.setLoadingMode(LoadingManagerMode.Manual); // Initialize SDK - adManager = CAS.buildManager() + CAS.buildManager() .withManagerId("demo") .withAdTypes(AdType.Banner, AdType.Interstitial, AdType.Rewarded) .withTestAdMode(true) .withConsentFlow( new ConsentFlow(true) - //.withPrivacyPolicy("http://") + .withDismissListener(status -> { + Log.d(TAG, "Consent Flow dismissed"); + }) ) .withCompletionListener(config -> { - if (config.getError() == null) + if (config.getError() == null) { Log.d(TAG, "Ad manager initialized"); - else + adManager = config.getManager(); + } else { Log.d(TAG, "Ad manager initialization failed: " + config.getError()); + } }) .initialize(this); } diff --git a/kotlinSample/build.gradle b/kotlinSample/build.gradle index 113c3a2..c5605f7 100644 --- a/kotlinSample/build.gradle +++ b/kotlinSample/build.gradle @@ -27,8 +27,8 @@ android { // Required version compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/kotlinSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.kt b/kotlinSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.kt index b238116..2cff6ff 100644 --- a/kotlinSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.kt +++ b/kotlinSample/src/main/java/com/cleveradssolutions/sampleapp/SampleApplication.kt @@ -23,19 +23,23 @@ class SampleApplication : Application() { //CAS.settings.loadingMode = LoadingManagerMode.Manual // Initialize SDK - adManager = CAS.buildManager() + CAS.buildManager() .withManagerId("demo") .withTestAdMode(true) .withAdTypes(AdType.Banner, AdType.Interstitial, AdType.Rewarded) .withConsentFlow( ConsentFlow(isEnabled = true) - //.withPrivacyPolicy("https://url") + .withDismissListener{ + Log.d(TAG, "Consent flow dismissed") + } ) .withCompletionListener { - if (it.error == null) + if (it.error == null) { Log.d(TAG, "Ad manager initialized") - else + adManager = it.manager + } else { Log.d(TAG, "Ad manager initialization failed: " + it.error) + } } .initialize(this) }