Skip to content

Commit

Permalink
Version 3.15.0 of the Google Mobile Ads Unity plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rampara committed Jul 24, 2018
1 parent 7c7e357 commit 1c08a82
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 24 deletions.
21 changes: 21 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
Google Mobile Ads Unity Plugin Change Log

**************
Version 3.15.0
**************

Plugin:
- Forward Android ad events on background thread through JNI interface
to mitigate ANRs.

Mediation packages:
- Updated AppLovin Unity package to v3.0.3.
- Updated Chartboost Unity package to v1.1.1.
- Updated Facebook Unity package to v1.1.3.
- Updated IronSource Unity package to v1.0.2.
- Updated Nend Unity package to v2.0.0.
- Updated Tapjoy Unity package to v2.0.0.

Built and tested with:
- Google Play services 15.0.1
- Google Mobile Ads iOS SDK 7.31.0
- Unity Jar Resolver 1.2.79.0

**************
Version 3.14.0
**************
Expand Down
2 changes: 1 addition & 1 deletion source/android-library/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ task clearJar(type: Delete) {
}

task makeJar(type: Copy) {
from('build/intermediates/bundles/release/')
from('build/intermediates/intermediate-jars/release/')
into('build/libs/')
include('classes.jar')
rename('classes.jar', 'unity-plugin-library.jar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,35 +168,72 @@ public void onAdLoaded() {
if (!mPopupWindow.isShowing() && !mHidden) {
showPopUpWindow();
}
mUnityListener.onAdLoaded();

new Thread(new Runnable() {
@Override
public void run() {
if (mUnityListener != null) {
mUnityListener.onAdLoaded();
}
}
}).start();
}
}

@Override
public void onAdFailedToLoad(int errorCode) {
public void onAdFailedToLoad(final int errorCode) {
if (mUnityListener != null) {
mUnityListener.onAdFailedToLoad(PluginUtils.getErrorReason(errorCode));
new Thread(new Runnable() {
@Override
public void run() {
if (mUnityListener != null) {
mUnityListener.onAdFailedToLoad(
PluginUtils.getErrorReason(errorCode));
}
}
}).start();
}
}

@Override
public void onAdOpened() {
if (mUnityListener != null) {
mUnityListener.onAdOpened();
new Thread(new Runnable() {
@Override
public void run() {
if (mUnityListener != null) {
mUnityListener.onAdOpened();
}
}
}).start();
}
}

@Override
public void onAdClosed() {
if (mUnityListener != null) {
mUnityListener.onAdClosed();
new Thread(new Runnable() {
@Override
public void run() {
if (mUnityListener != null) {
mUnityListener.onAdClosed();
}
}
}).start();
}
}

@Override
public void onAdLeftApplication() {
if (mUnityListener != null) {
mUnityListener.onAdLeftApplication();
new Thread(new Runnable() {
@Override
public void run() {
if (mUnityListener != null) {
mUnityListener.onAdLeftApplication();
}
}
}).start();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,73 @@ public void run() {
@Override
public void onAdLoaded() {
isLoaded = true;
adListener.onAdLoaded();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdLoaded();
}
}
}).start();
}
}

@Override
public void onAdFailedToLoad(int errorCode) {
adListener.onAdFailedToLoad(PluginUtils.getErrorReason(errorCode));
public void onAdFailedToLoad(final int errorCode) {
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdFailedToLoad(
PluginUtils.getErrorReason(errorCode));
}
}
}).start();
}
}

@Override
public void onAdOpened() {
adListener.onAdOpened();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdOpened();
}
}
}).start();
}
}

@Override
public void onAdClosed() {
adListener.onAdClosed();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdClosed();
}
}
}).start();
}
}

@Override
public void onAdLeftApplication() {
adListener.onAdLeftApplication();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdLeftApplication();
}
}
}).start();
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,42 +67,116 @@ public void run() {
@Override
public void onRewardedVideoAdLoaded() {
isLoaded = true;
adListener.onAdLoaded();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdLoaded();
}
}
}).start();
}
}

@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
adListener.onAdFailedToLoad(PluginUtils.getErrorReason(errorCode));
public void onRewardedVideoAdFailedToLoad(final int errorCode) {
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdFailedToLoad(
PluginUtils.getErrorReason(errorCode));
}
}
}).start();
}
}

@Override
public void onRewardedVideoAdOpened() {
adListener.onAdOpened();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdOpened();
}
}
}).start();
}
}

@Override
public void onRewardedVideoStarted() {
adListener.onAdStarted();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdStarted();
}
}
}).start();
}
}

@Override
public void onRewardedVideoAdClosed() {
adListener.onAdClosed();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdClosed();
}
}
}).start();
}
}

@Override
public void onRewarded(RewardItem reward) {
adListener.onAdRewarded(reward.getType(), reward.getAmount());
public void onRewarded(final RewardItem reward) {
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdRewarded(reward.getType(),
reward.getAmount());
}
}
}).start();
}
}

@Override
public void onRewardedVideoAdLeftApplication() {
adListener.onAdLeftApplication();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdLeftApplication();
}
}
}).start();
}
}

@Override
public void onRewardedVideoCompleted() {
adListener.onAdCompleted();
if (adListener != null) {
new Thread(new Runnable() {
@Override
public void run() {
if (adListener != null) {
adListener.onAdCompleted();
}
}
}).start();
}
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion source/plugin/Assets/GoogleMobileAds/Api/AdRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace GoogleMobileAds.Api
{
public class AdRequest
{
public const string Version = "3.14.0";
public const string Version = "3.15.0";
public const string TestDeviceSimulator = "SIMULATOR";

private AdRequest(Builder builder)
Expand Down

0 comments on commit 1c08a82

Please sign in to comment.