From 3b8861c05e7f65048a8532479e9155cccf7814dd Mon Sep 17 00:00:00 2001 From: Tanya Stasenko Date: Fri, 21 Jan 2022 17:40:10 +0300 Subject: [PATCH] release-adapter-ironsource-4.5.0.2 --- .../app/build.gradle | 6 +- .../.gitignore | 35 ++++ .../app/.gitignore | 35 ++++ .../app/build.gradle | 46 +++++ .../app/proguard-rules.pro | 17 ++ .../app/src/main/AndroidManifest.xml | 36 ++++ .../rewarded/sample/Application.java | 33 ++++ .../rewarded/sample/MainActivity.java | 142 +++++++++++++++ .../app/src/main/res/layout/activity_main.xml | 34 ++++ .../app/src/main/res/menu/menu_main.xml | 18 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 4917 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 4017 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 5776 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7442 bytes .../app/src/main/res/values-w820dp/dimens.xml | 15 ++ .../app/src/main/res/values/dimens.xml | 14 ++ .../app/src/main/res/values/strings.xml | 17 ++ .../app/src/main/res/values/styles.xml | 17 ++ .../main/res/xml/network_security_config.xml | 8 + .../build.gradle | 35 ++++ .../gradle.properties | 31 ++++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + .../IronsourceRewardedAdapterExample/gradlew | 164 ++++++++++++++++++ .../gradlew.bat | 90 ++++++++++ .../settings.gradle | 10 ++ SDK/adapter/ironsource-adapter/CHANGELOG.md | 14 +- .../ironsource-mobileads-4.5.0.0.aar | Bin 44508 -> 0 bytes .../ironsource-mobileads-4.5.0.2.aar | Bin 0 -> 48680 bytes 29 files changed, 819 insertions(+), 4 deletions(-) create mode 100644 Examples/IronsourceRewardedAdapterExample/.gitignore create mode 100644 Examples/IronsourceRewardedAdapterExample/app/.gitignore create mode 100644 Examples/IronsourceRewardedAdapterExample/app/build.gradle create mode 100644 Examples/IronsourceRewardedAdapterExample/app/proguard-rules.pro create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/AndroidManifest.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/Application.java create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/MainActivity.java create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/layout/activity_main.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/menu/menu_main.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/values-w820dp/dimens.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/values/dimens.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/values/strings.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/values/styles.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/app/src/main/res/xml/network_security_config.xml create mode 100644 Examples/IronsourceRewardedAdapterExample/build.gradle create mode 100644 Examples/IronsourceRewardedAdapterExample/gradle.properties create mode 100644 Examples/IronsourceRewardedAdapterExample/gradle/wrapper/gradle-wrapper.jar create mode 100644 Examples/IronsourceRewardedAdapterExample/gradle/wrapper/gradle-wrapper.properties create mode 100755 Examples/IronsourceRewardedAdapterExample/gradlew create mode 100644 Examples/IronsourceRewardedAdapterExample/gradlew.bat create mode 100644 Examples/IronsourceRewardedAdapterExample/settings.gradle delete mode 100644 SDK/adapter/ironsource-adapter/ironsource-mobileads-4.5.0.0.aar create mode 100644 SDK/adapter/ironsource-adapter/ironsource-mobileads-4.5.0.2.aar diff --git a/Examples/IronsourceInterstitialAdapterExample/app/build.gradle b/Examples/IronsourceInterstitialAdapterExample/app/build.gradle index 31671e06..5d73c497 100644 --- a/Examples/IronsourceInterstitialAdapterExample/app/build.gradle +++ b/Examples/IronsourceInterstitialAdapterExample/app/build.gradle @@ -39,8 +39,8 @@ dependencies { implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.yandex.android:mobmetricalib:4.0.0' + implementation 'com.yandex.android:mobmetricalib:4.1.1' implementation 'com.yandex.android:mobileads:4.5.0' - implementation 'com.yandex.ads.adapter:ironsource-mobileads:4.5.0.0' - implementation 'com.ironsource.sdk:mediationsdk:7.1.10' + implementation 'com.yandex.ads.adapter:ironsource-mobileads:4.5.0.2' + implementation 'com.ironsource.sdk:mediationsdk:7.1.14' } diff --git a/Examples/IronsourceRewardedAdapterExample/.gitignore b/Examples/IronsourceRewardedAdapterExample/.gitignore new file mode 100644 index 00000000..2d9be3a5 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/.gitignore @@ -0,0 +1,35 @@ +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/** +gen/** +out/** +gen-external-apklibs/** + +# Local configuration file (sdk path, etc) +local.properties + +# IntellijJ IDEA +*.iml +*.ipr +*.iws +.idea/** +classes/** +target/** + +# Mac OS +.DS_Store + +# Gradle +gradle-app.setting +.gradletasknamecache +.gradle/** +build/** \ No newline at end of file diff --git a/Examples/IronsourceRewardedAdapterExample/app/.gitignore b/Examples/IronsourceRewardedAdapterExample/app/.gitignore new file mode 100644 index 00000000..2d9be3a5 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/.gitignore @@ -0,0 +1,35 @@ +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/** +gen/** +out/** +gen-external-apklibs/** + +# Local configuration file (sdk path, etc) +local.properties + +# IntellijJ IDEA +*.iml +*.ipr +*.iws +.idea/** +classes/** +target/** + +# Mac OS +.DS_Store + +# Gradle +gradle-app.setting +.gradletasknamecache +.gradle/** +build/** \ No newline at end of file diff --git a/Examples/IronsourceRewardedAdapterExample/app/build.gradle b/Examples/IronsourceRewardedAdapterExample/app/build.gradle new file mode 100644 index 00000000..5d73c497 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/build.gradle @@ -0,0 +1,46 @@ +/* + * This file is a part of the Yandex Advertising Network + * + * Version for Android (C) 2021 YANDEX + * + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://legal.yandex.com/partner_ch/ + */ + +apply plugin: 'com.android.application' + +android { + compileSdkVersion 30 + buildToolsVersion '30.0.2' + + defaultConfig { + applicationId "com.yandex.ironsourceadapter.interstitial.sample" + minSdkVersion 19 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + multiDexEnabled true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation 'androidx.multidex:multidex:2.0.1' + implementation 'androidx.appcompat:appcompat:1.2.0' + + implementation 'com.yandex.android:mobmetricalib:4.1.1' + implementation 'com.yandex.android:mobileads:4.5.0' + implementation 'com.yandex.ads.adapter:ironsource-mobileads:4.5.0.2' + implementation 'com.ironsource.sdk:mediationsdk:7.1.14' +} diff --git a/Examples/IronsourceRewardedAdapterExample/app/proguard-rules.pro b/Examples/IronsourceRewardedAdapterExample/app/proguard-rules.pro new file mode 100644 index 00000000..cbc1b539 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/satsakul/ADT/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/Examples/IronsourceRewardedAdapterExample/app/src/main/AndroidManifest.xml b/Examples/IronsourceRewardedAdapterExample/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..5cb7e72a --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/src/main/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/Application.java b/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/Application.java new file mode 100644 index 00000000..866db684 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/Application.java @@ -0,0 +1,33 @@ +/* + * This file is a part of the Yandex Advertising Network + * + * Version for Android (C) 2021 YANDEX + * + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://legal.yandex.com/partner_ch/ + */ +package com.yandex.ironsourceadapter.rewarded.sample; + +import android.util.Log; + +import androidx.multidex.MultiDexApplication; + +import com.yandex.mobile.ads.common.InitializationListener; +import com.yandex.mobile.ads.common.MobileAds; + +public class Application extends MultiDexApplication { + + private static final String YANDEX_MOBILE_ADS_TAG = "YandexMobileAds"; + + @Override + public void onCreate() { + super.onCreate(); + + MobileAds.initialize(this, new InitializationListener() { + @Override + public void onInitializationCompleted() { + Log.d(YANDEX_MOBILE_ADS_TAG, "SDK initialized"); + } + }); + } +} diff --git a/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/MainActivity.java b/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/MainActivity.java new file mode 100644 index 00000000..7c2d751e --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/src/main/java/com/yandex/ironsourceadapter/rewarded/sample/MainActivity.java @@ -0,0 +1,142 @@ +/* + * This file is a part of the Yandex Advertising Network + * + * Version for Android (C) 2021 YANDEX + * + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://legal.yandex.com/partner_ch/ + */ +package com.yandex.ironsourceadapter.rewarded.sample; + +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + +import com.ironsource.mediationsdk.IronSource; +import com.ironsource.mediationsdk.integration.IntegrationHelper; +import com.ironsource.mediationsdk.logger.IronSourceError; +import com.ironsource.mediationsdk.model.Placement; +import com.ironsource.mediationsdk.sdk.RewardedVideoListener; + +public class MainActivity extends AppCompatActivity { + + private static final String APP_KEY = "85460dcd"; + private static final String TAG = "MainActivity"; + + private Button mLoadRewardedAdButton; + private Button mShowRewardedAdButton; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + mLoadRewardedAdButton = findViewById(R.id.load_rewarded_button); + mLoadRewardedAdButton.setOnClickListener(mLoadRewardedClickListener); + + mShowRewardedAdButton = findViewById(R.id.show_rewarded_button); + mShowRewardedAdButton.setOnClickListener(mShowRewardedClickListener); + mShowRewardedAdButton.setEnabled(false); + + IntegrationHelper.validateIntegration(this); + + IronSource.init(this, APP_KEY, IronSource.AD_UNIT.INTERSTITIAL); + } + + @Override + protected void onResume() { + super.onResume(); + IronSource.onResume(this); + } + + @Override + protected void onPause() { + super.onPause(); + IronSource.onPause(this); + } + + @Override + protected void onDestroy() { + IronSource.setInterstitialListener(null); + super.onDestroy(); + } + + private final View.OnClickListener mLoadRewardedClickListener = new View.OnClickListener() { + @Override + public void onClick(@NonNull final View v) { + mLoadRewardedAdButton.setEnabled(false); + mLoadRewardedAdButton.setText(getResources().getText(R.string.start_load_rewarded_button)); + + IronSource.setRewardedVideoListener(new IronSourceRewardedListener()); + IronSource.loadRewardedVideo(); + } + }; + + private final View.OnClickListener mShowRewardedClickListener = new View.OnClickListener() { + @Override + public void onClick(@NonNull final View v) { + if (IronSource.isInterstitialReady()) { + IronSource.showInterstitial(); + } + + mShowRewardedAdButton.setEnabled(false); + } + }; + + private class IronSourceRewardedListener implements RewardedVideoListener { + + @Override + public void onRewardedVideoAdOpened() { + mShowRewardedAdButton.post(() -> { + mShowRewardedAdButton.setEnabled(true); + mLoadRewardedAdButton.setEnabled(true); + mLoadRewardedAdButton.setText(getResources().getText(R.string.load_rewarded_button)); + }); + } + + @Override + public void onRewardedVideoAdClosed() { + Log.d(TAG, "onRewardedVideoAdClosed()"); + } + + @Override + public void onRewardedVideoAvailabilityChanged(boolean b) { + Log.d(TAG, "onRewardedVideoAvailabilityChanged()"); + } + + @Override + public void onRewardedVideoAdStarted() { + Log.d(TAG, "onRewardedVideoAdStarted()"); + } + + @Override + public void onRewardedVideoAdEnded() { + Log.d(TAG, "onRewardedVideoAdEnded()"); + } + + @Override + public void onRewardedVideoAdRewarded(Placement placement) { + Log.d(TAG, "onRewardedVideoAdRewarded()"); + } + + @Override + public void onRewardedVideoAdShowFailed(IronSourceError ironSourceError) { + final String errorMessage = String.format("onRewardedVideoAdShowFailed() code = %s, message = %s", + ironSourceError.getErrorCode(), ironSourceError.getErrorMessage()); + Log.d(TAG, errorMessage); + mLoadRewardedAdButton.post(() -> { + mLoadRewardedAdButton.setEnabled(true); + mLoadRewardedAdButton.setText(getResources().getText(R.string.load_rewarded_button)); + }); + } + + @Override + public void onRewardedVideoAdClicked(Placement placement) { + Log.d(TAG, "onRewardedVideoAdClicked()"); + } + } +} diff --git a/Examples/IronsourceRewardedAdapterExample/app/src/main/res/layout/activity_main.xml b/Examples/IronsourceRewardedAdapterExample/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..f1bbaf15 --- /dev/null +++ b/Examples/IronsourceRewardedAdapterExample/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,34 @@ + + + + +