Skip to content

Commit 5502e5f

Browse files
Mobile Ads Developer Relationscopybara-github
authored andcommitted
This change updates the Google Mobile Ads Unity plugin's iOS component from a static library (.a) to an XCFramework (.xcframework).
PiperOrigin-RevId: 933340152
1 parent 9412d4c commit 5502e5f

2 files changed

Lines changed: 42 additions & 15 deletions

File tree

Info.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleName</key>
6+
<string>$(PRODUCT_NAME)</string>
7+
<key>CFBundleVersion</key>
8+
<string>1.0</string>
9+
<key>CFBundleShortVersionString</key>
10+
<string>1.0</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundlePackageType</key>
14+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
15+
<key>MinimumOSVersion</key>
16+
<string>13.0</string>
17+
</dict>
18+
</plist>

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void CreateBannerView(string adUnitId, AdSize adSize, AdPosition position
5656
{
5757
_adUnitId = adUnitId;
5858

59-
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive)
59+
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive || adSize.AdType == AdSize.Type.LargeAnchoredAdaptive)
6060
{
6161
SetAndStretchAd(position, adSize);
6262
}
@@ -75,7 +75,7 @@ public void CreateBannerView(string adUnitId, AdSize adSize, int x, int y)
7575
{
7676
_adUnitId = adUnitId;
7777
RectTransform rect = GetRectTransform();
78-
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive)
78+
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive || adSize.AdType == AdSize.Type.LargeAnchoredAdaptive)
7979
{
8080
SetAndStretchAd(0, adSize);
8181
rect.anchoredPosition = new Vector3(0, y, 1);
@@ -93,7 +93,7 @@ bool CreateBannerView(AdSize adSize, AdPosition? position)
9393
{
9494
string prefabName;
9595

96-
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive)
96+
if (adSize == AdSize.SmartBanner || adSize.AdType == AdSize.Type.AnchoredAdaptive || adSize.AdType == AdSize.Type.LargeAnchoredAdaptive)
9797
{
9898
if (position.HasValue && position.Value == AdPosition.Center)
9999
{
@@ -296,6 +296,23 @@ private void SetAndStretchAd(AdPosition pos, AdSize adSize)
296296

297297
rect.pivot = new Vector2(0.5f, 0.5f);
298298

299+
Text adText = _gameObject.GetComponentInChildren<Text>();
300+
if (adText != null)
301+
{
302+
if (adSize.AdType == AdSize.Type.AnchoredAdaptive)
303+
{
304+
adText.text = "This is a Test Adaptive Banner";
305+
}
306+
else if (adSize.AdType == AdSize.Type.LargeAnchoredAdaptive)
307+
{
308+
adText.text = "This is a Test Large Adaptive Banner";
309+
}
310+
else if (adSize == AdSize.SmartBanner)
311+
{
312+
adText.text = "This is a Test Smart Banner";
313+
}
314+
}
315+
299316
if (pos == AdPosition.Bottom || pos == AdPosition.BottomLeft || pos == AdPosition.BottomRight)
300317
{
301318
rect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, 0, rect.sizeDelta.y);
@@ -308,21 +325,13 @@ private void SetAndStretchAd(AdPosition pos, AdSize adSize)
308325
}
309326
else if (pos == AdPosition.Center)
310327
{
311-
if (adSize.AdType == AdSize.Type.AnchoredAdaptive)
312-
{
313-
Text adText = _gameObject.GetComponentInChildren<Text>();
314-
adText.text = "This is a Test Adaptive Banner";
315-
}
316-
else if (adSize == AdSize.SmartBanner)
317-
{
318-
Text adText = _gameObject.GetComponentInChildren<Text>();
319-
adText.text = "This is a Test Smart Banner";
320-
}
321-
else
328+
if (adSize.AdType != AdSize.Type.AnchoredAdaptive &&
329+
adSize.AdType != AdSize.Type.LargeAnchoredAdaptive &&
330+
adSize != AdSize.SmartBanner)
322331
{
323332
rect.anchoredPosition = new Vector2(0, 0);
324333
}
325-
}
334+
}
326335
else
327336
{
328337
rect.anchoredPosition = rect.position;

0 commit comments

Comments
 (0)