Skip to content

Commit 0e87ab0

Browse files
Samuel Stowmaddevrelgithubbot
Samuel Stow
authored andcommitted
Update for version 3.18.0 release.
PiperOrigin-RevId: 254288644
1 parent 3dbf548 commit 0e87ab0

File tree

14 files changed

+20
-208
lines changed

14 files changed

+20
-208
lines changed

ChangeLog.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Google Mobile Ads Unity Plugin Change Log
22

3+
**************
4+
Version 3.18.0
5+
**************
6+
7+
Plugin:
8+
- Added GoogleMobileAdsSettings editor UI for making Plist / manifest changes.
9+
- Fix OnRewardedAdFailedToShow callbacks.
10+
- Migrated android support library to androidx (JetPack) with Google Mobile Ads
11+
SDK version 18.0.0.
12+
13+
Built and tested with:
14+
- Google Play services 18.0.0
15+
- Google Mobile Ads iOS SDK 7.45.0
16+
- Unity Jar Resolver 1.2.119
17+
318
**************
419
Version 3.17.0
520
**************

source/android-library/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323

2424
dependencies {
2525
implementation fileTree(dir: 'libs', include: ['*.jar'])
26-
implementation 'com.android.support:appcompat-v7:26.1.0'
27-
implementation 'com.google.android.gms:play-services-ads:17.2.1'
26+
implementation 'androidx.appcompat:appcompat:1.0.0'
27+
implementation 'com.google.android.gms:play-services-ads:18.0.0'
2828
}
2929

3030
task clearJar(type: Delete) {

source/android-library/app/src/main/java/com/google/unity/ads/UnityRewardedAd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.google.unity.ads;
22

33
import android.app.Activity;
4-
import android.support.annotation.NonNull;
54
import android.util.Log;
5+
import androidx.annotation.NonNull;
66
import com.google.android.gms.ads.AdRequest;
77
import com.google.android.gms.ads.rewarded.RewardItem;
88
import com.google.android.gms.ads.rewarded.RewardedAd;

source/plugin/Assets/GoogleMobileAds/Api/AdRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace GoogleMobileAds.Api
2121
{
2222
public class AdRequest
2323
{
24-
public const string Version = "3.17.0";
24+
public const string Version = "3.18.0";
2525
public const string TestDeviceSimulator = "SIMULATOR";
2626

2727
private AdRequest(Builder builder)

source/plugin/Assets/GoogleMobileAds/Api/AdSize.cs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,8 @@
1515
namespace GoogleMobileAds.Api
1616
{
1717

18-
// copybara_strip_begin
19-
internal enum Orientation {
20-
Current = 0,
21-
Landscape = 1,
22-
Portrait = 2
23-
}
24-
// copybara_strip_end
25-
2618
public class AdSize
2719
{
28-
// copybara_strip_begin
29-
private bool isAdaptiveBanner;
30-
private Orientation orientation;
31-
// copybara_strip_end
3220
private bool isSmartBanner;
3321
private int width;
3422
private int height;
@@ -45,38 +33,12 @@ public AdSize(int width, int height)
4533
isSmartBanner = false;
4634
this.width = width;
4735
this.height = height;
48-
// copybara_strip_begin
49-
isAdaptiveBanner = false;
50-
this.orientation = Orientation.Current;
51-
// copybara_strip_end
5236
}
5337

5438
private AdSize(bool isSmartBanner) : this(0, 0)
5539
{
5640
this.isSmartBanner = isSmartBanner;
5741
}
58-
// copybara_strip_begin
59-
private static AdSize CreateAdaptiveAdSize(int width, Orientation orientation)
60-
{
61-
AdSize adSize = new AdSize(width, 0);
62-
adSize.isAdaptiveBanner = true;
63-
adSize.orientation = orientation;
64-
return adSize;
65-
}
66-
67-
68-
public static AdSize GetLandscapeBannerAdSizeWithWidth(int width) {
69-
return CreateAdaptiveAdSize(width, Orientation.Landscape);
70-
}
71-
72-
public static AdSize GetPortraitBannerAdSizeWithWidth(int width) {
73-
return CreateAdaptiveAdSize(width, Orientation.Portrait);
74-
}
75-
76-
public static AdSize GetCurrentOrientationBannerAdSizeWithWidth(int width) {
77-
return CreateAdaptiveAdSize(width, Orientation.Current);
78-
}
79-
// copybara_strip_end
8042
public int Width
8143
{
8244
get
@@ -100,23 +62,6 @@ public bool IsSmartBanner
10062
return isSmartBanner;
10163
}
10264
}
103-
// copybara_strip_begin
104-
public bool IsAdaptiveBanner
105-
{
106-
get
107-
{
108-
return isAdaptiveBanner;
109-
}
110-
}
111-
112-
internal Orientation Orientation
113-
{
114-
get
115-
{
116-
return orientation;
117-
}
118-
}
119-
// copybara_strip_end
12065

12166
public override bool Equals(object obj)
12267
{
@@ -125,9 +70,6 @@ public override bool Equals(object obj)
12570

12671
AdSize other = (AdSize)obj;
12772
return (width == other.width) && (height == other.height)
128-
// copybara_strip_begin
129-
&& (isAdaptiveBanner == other.isAdaptiveBanner) && (orientation == other.orientation)
130-
// copybara_strip_end
13173
&& (isSmartBanner == other.isSmartBanner);
13274
}
13375

@@ -150,10 +92,6 @@ public override int GetHashCode()
15092
hash = (hash * hashMultiplier) ^ width.GetHashCode();
15193
hash = (hash * hashMultiplier) ^ height.GetHashCode();
15294
hash = (hash * hashMultiplier) ^ isSmartBanner.GetHashCode();
153-
// copybara_strip_begin
154-
hash = (hash * hashMultiplier) ^ isAdaptiveBanner.GetHashCode();
155-
hash = (hash * hashMultiplier) ^ orientation.GetHashCode();
156-
// copybara_strip_end
15795
return hash;
15896
}
15997
}

source/plugin/Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<dependencies>
22
<androidPackages>
3-
<androidPackage spec="com.google.android.gms:play-services-ads:17.2.0">
3+
<androidPackage spec="com.google.android.gms:play-services-ads:18.0.0">
44
<repositories>
55
<repository>https://maven.google.com/</repository>
66
</repositories>

source/plugin/Assets/GoogleMobileAds/Platforms/iOS/BannerClient.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ public void CreateBannerView(string adUnitId, AdSize adSize, AdPosition position
8181
this.BannerViewPtr = Externs.GADUCreateSmartBannerView(
8282
this.bannerClientPtr, adUnitId, (int)position);
8383
}
84-
// copybara_strip_begin
85-
else if (adSize.IsAdaptiveBanner)
86-
{
87-
this.BannerViewPtr = Externs.GADUCreateAdaptiveBannerView(
88-
this.bannerClientPtr,
89-
adUnitId,
90-
adSize.Width,
91-
(int)adSize.Orientation,
92-
(int)position);
93-
}
94-
// copybara_strip_end
9584
else
9685
{
9786
this.BannerViewPtr = Externs.GADUCreateBannerView(
@@ -120,18 +109,6 @@ public void CreateBannerView(string adUnitId, AdSize adSize, int x, int y)
120109
x,
121110
y);
122111
}
123-
// copybara_strip_begin
124-
else if (adSize.IsAdaptiveBanner)
125-
{
126-
this.BannerViewPtr = Externs.GADUCreateAdaptiveBannerViewWithCustomPosition(
127-
this.bannerClientPtr,
128-
adUnitId,
129-
adSize.Width,
130-
(int)adSize.Orientation,
131-
x,
132-
y);
133-
}
134-
// copybara_strip_end
135112
else
136113
{
137114
this.BannerViewPtr = Externs.GADUCreateBannerViewWithCustomPosition(

source/plugin/Assets/GoogleMobileAds/Platforms/iOS/Externs.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,6 @@ internal static extern IntPtr GADUCreateSmartBannerView(
103103
[DllImport("__Internal")]
104104
internal static extern IntPtr GADUCreateSmartBannerViewWithCustomPosition(
105105
IntPtr bannerClient, string adUnitId, int x, int y);
106-
// copybara_strip_begin
107-
[DllImport("__Internal")]
108-
internal static extern IntPtr GADUCreateAdaptiveBannerView(
109-
IntPtr bannerClient,
110-
string adUnitId,
111-
int width,
112-
int orientation,
113-
int positionAtTop);
114-
115-
[DllImport("__Internal")]
116-
internal static extern IntPtr GADUCreateAdaptiveBannerViewWithCustomPosition(
117-
IntPtr bannerClient,
118-
string adUnitId,
119-
int width,
120-
int orientation,
121-
int x,
122-
int y);
123-
// copybara_strip_end
124106
[DllImport("__Internal")]
125107
internal static extern void GADUSetBannerCallbacks(
126108
IntPtr bannerView,

source/plugin/Assets/Plugins/iOS/GADUBanner.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,6 @@
3535
adUnitID:(NSString *)adUnitID
3636
customAdPosition:(CGPoint)customAdPosition;
3737

38-
// copybara_strip_begin
39-
/// Initializes an adaptive GADUBanner, positioned at either the top or bottom of the screen.
40-
- (id)initWithAdaptiveBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
41-
adUnitID:(NSString *)adUnitID
42-
width:(NSInteger)width
43-
orientation:(GADUBannerOrientation)orientation
44-
adPosition:(GADAdPosition)adPosition;
45-
46-
/// Initializes an adaptive GADUBanner with a custom position at given point from top left.
47-
- (id)initWithAdaptiveBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
48-
adUnitID:(NSString *)adUnitID
49-
width:(NSInteger)width
50-
orientation:(GADUBannerOrientation)orientation
51-
customAdPosition:(CGPoint)customAdPosition;
52-
// copybara_strip_end
5338
/// A reference to the Unity banner client.
5439
@property(nonatomic, assign) GADUTypeBannerClientRef *bannerClient;
5540

source/plugin/Assets/Plugins/iOS/GADUBanner.m

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,6 @@ - (id)initWithSmartBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *
7676
customAdPosition:customAdPosition];
7777
}
7878

79-
// copybara_strip_begin
80-
- (id)initWithAdaptiveBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
81-
adUnitID:(NSString *)adUnitID
82-
width:(NSInteger)width
83-
orientation:(GADUBannerOrientation)orientation
84-
adPosition:(GADAdPosition)adPosition {
85-
return [self initWithBannerClientReference:bannerClient
86-
adUnitID:adUnitID
87-
adSize:[GADUPluginUtil adaptiveAdSizeForWidth:(CGFloat)width
88-
orientation:orientation]
89-
adPosition:adPosition];
90-
}
91-
92-
- (id)initWithAdaptiveBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
93-
adUnitID:(NSString *)adUnitID
94-
width:(NSInteger)width
95-
orientation:(GADUBannerOrientation)orientation
96-
customAdPosition:(CGPoint)customAdPosition {
97-
return [self initWithBannerClientReference:bannerClient
98-
adUnitID:adUnitID
99-
adSize:[GADUPluginUtil adaptiveAdSizeForWidth:(CGFloat)width
100-
orientation:orientation]
101-
customAdPosition:customAdPosition];
102-
}
103-
// copybara_strip_end
104-
10579
- (id)initWithBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
10680
adUnitID:(NSString *)adUnitID
10781
adSize:(GADAdSize)size

source/plugin/Assets/Plugins/iOS/GADUInterface.m

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -133,41 +133,6 @@ GADUTypeBannerRef GADUCreateSmartBannerViewWithCustomPosition(GADUTypeBannerClie
133133
[cache.references setObject:banner forKey:[banner gadu_referenceKey]];
134134
return (__bridge GADUTypeBannerRef)banner;
135135
}
136-
// copybara_strip_begin
137-
/// Creates a an adaptive sized GADBannerView with the specified width, orientation, and position.
138-
/// Returns a reference to the GADUBannerView.
139-
GADUTypeBannerRef GADUCreateAdaptiveBannerView(GADUTypeBannerClientRef *bannerClient,
140-
const char *adUnitID, NSInteger width,
141-
GADUBannerOrientation orientation,
142-
GADAdPosition adPosition) {
143-
GADUBanner *banner = [[GADUBanner alloc]
144-
initWithAdaptiveBannerSizeAndBannerClientReference:bannerClient
145-
adUnitID:GADUStringFromUTF8String(adUnitID)
146-
width:(int)width
147-
orientation:orientation
148-
adPosition:adPosition];
149-
GADUObjectCache *cache = [GADUObjectCache sharedInstance];
150-
[cache.references setObject:banner forKey:[banner gadu_referenceKey]];
151-
return (__bridge GADUTypeBannerRef)banner;
152-
}
153-
154-
/// Creates a an adaptive sized GADBannerView with the specified width, orientation, and position.
155-
/// Returns a reference to the GADUBannerView.
156-
GADUTypeBannerRef GADUCreateAdaptiveBannerViewWithCustomPosition(
157-
GADUTypeBannerClientRef *bannerClient, const char *adUnitID, NSInteger width,
158-
GADUBannerOrientation orientation, NSInteger x, NSInteger y) {
159-
CGPoint adPosition = CGPointMake(x, y);
160-
GADUBanner *banner = [[GADUBanner alloc]
161-
initWithAdaptiveBannerSizeAndBannerClientReference:bannerClient
162-
adUnitID:GADUStringFromUTF8String(adUnitID)
163-
width:(int)width
164-
orientation:orientation
165-
customAdPosition:adPosition];
166-
GADUObjectCache *cache = [GADUObjectCache sharedInstance];
167-
[cache.references setObject:banner forKey:[banner gadu_referenceKey]];
168-
return (__bridge GADUTypeBannerRef)banner;
169-
}
170-
// copybara_strip_end
171136

172137
/// Creates a GADUInterstitial and returns its reference.
173138
GADUTypeInterstitialRef GADUCreateInterstitial(GADUTypeInterstitialClientRef *interstitialClient,

source/plugin/Assets/Plugins/iOS/GADUPluginUtil.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030

3131
/// Returns a GADAdSize for a specified width and height.
3232
+ (GADAdSize)adSizeForWidth:(CGFloat)width height:(CGFloat)height;
33-
// copybara_strip_begin
34-
/// Returns the anchored adaptive banner ad size for the given width and orientation.
35-
+ (GADAdSize)adaptiveAdSizeForWidth:(CGFloat)width orientation:(GADUBannerOrientation)orientation;
36-
// copybara_strip_end
3733
/// If requesting smart banner landscape, returns the custom size for landscape smart banners which
3834
/// is full width of the safe area and auto height. Assumes that the application window is visible.
3935
/// If requesting any other ad size, returns the un-modified ad size.

source/plugin/Assets/Plugins/iOS/GADUPluginUtil.m

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,5 @@ + (GADAdSize)adSizeForWidth:(CGFloat)width height:(CGFloat)height {
149149
}
150150
return GADAdSizeFromCGSize(CGSizeMake(width, height));
151151
}
152-
// copybara_strip_begin
153-
+ (GADAdSize)adaptiveAdSizeForWidth:(CGFloat)width orientation:(GADUBannerOrientation)orientation {
154-
switch (orientation) {
155-
case kGADUBannerOrientationCurrent:
156-
return GADCurrentOrientationBannerAdSizeWithWidth(width);
157-
case kGADUBannerOrientationLandscape:
158-
return GADLandscapeBannerAdSizeWithWidth(width);
159-
case kGADUBannerOrientationPortrait:
160-
return GADPortraitBannerAdSizeWithWidth(width);
161-
}
162-
}
163-
// copybara_strip_end
164152

165153
@end

source/plugin/Assets/Plugins/iOS/GADUTypes.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ typedef NS_ENUM(NSUInteger, GADAdPosition) {
1111
kGADAdPositionBottomRightOfScreen = 5, ///< Bottom right of screen.
1212
kGADAdPositionCenterOfScreen = 6 ///< Bottom right of screen.
1313
};
14-
// copybara_strip_begin
15-
/// Orientation for an adaptive banner.
16-
typedef NS_ENUM(NSUInteger, GADUBannerOrientation) {
17-
kGADUBannerOrientationCurrent = 0, ///< Current Orientation.
18-
kGADUBannerOrientationLandscape = 1, ///< Landscape.
19-
kGADUBannerOrientationPortrait = 2, ///< Portrait.
20-
};
21-
// copybara_strip_end
2214

2315
typedef NS_ENUM(NSInteger, GADUAdSize) { kGADUAdSizeUseFullWidth = -1 };
2416

0 commit comments

Comments
 (0)