From 92944e9accf3e9ff025379780a4d72ce8edfaaed Mon Sep 17 00:00:00 2001 From: Mariana Souza Date: Wed, 23 Oct 2024 14:32:58 -0400 Subject: [PATCH] Fix depricated values kGADAdSizeBanner and bottomLayoutGuide --- .github/workflows/ios-sdk-ci.yml | 10 +++++++--- demo-ios-objc/demo-ios-objc/GAMBannerViewController.m | 4 ++-- .../demo-ios-swift/GAMBannerViewController.swift | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ios-sdk-ci.yml b/.github/workflows/ios-sdk-ci.yml index 6c962b2..4256a98 100644 --- a/.github/workflows/ios-sdk-ci.yml +++ b/.github/workflows/ios-sdk-ci.yml @@ -36,6 +36,8 @@ jobs: build-demo-swift: name: "Build Demo Swift" runs-on: macos-14 + env: + FL_OUTPUT_DIR: output needs: [setup, sdk-tests] steps: - name: Checkout Code @@ -48,11 +50,13 @@ jobs: uses: actions/upload-artifact@v4 with: name: demo-swift - path: output/** + path: ./${{ env.FL_OUTPUT_DIR }}/** build-demo-objc: name: "Build Demo Objective-C" runs-on: macos-14 + env: + FL_OUTPUT_DIR: output needs: [setup, sdk-tests] steps: - name: Checkout Code @@ -64,5 +68,5 @@ jobs: - name: Store Artifacts uses: actions/upload-artifact@v4 with: - name: demo-objct - path: output/** + name: demo-objc + path: ./${{ env.FL_OUTPUT_DIR }}/** diff --git a/demo-ios-objc/demo-ios-objc/GAMBannerViewController.m b/demo-ios-objc/demo-ios-objc/GAMBannerViewController.m index 97137a3..443439e 100644 --- a/demo-ios-objc/demo-ios-objc/GAMBannerViewController.m +++ b/demo-ios-objc/demo-ios-objc/GAMBannerViewController.m @@ -21,7 +21,7 @@ @implementation GAMBannerViewController - (void)viewDidLoad { [super viewDidLoad]; - self.bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; + self.bannerView = [[GADBannerView alloc] initWithAdSize:GADAdSizeBanner]; self.bannerView.adUnitID = @"/22081946781/ios-sdk-demo/mobile-leaderboard"; [self addBannerViewToView:self.bannerView]; self.bannerView.rootViewController = self; @@ -76,7 +76,7 @@ - (void)addBannerViewToView:(UIView *)bannerView { [NSLayoutConstraint constraintWithItem:bannerView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual - toItem:self.bottomLayoutGuide + toItem:self.view.safeAreaLayoutGuide.bottomAnchor attribute:NSLayoutAttributeTop multiplier:1 constant:0], diff --git a/demo-ios-swift/demo-ios-swift/GAMBannerViewController.swift b/demo-ios-swift/demo-ios-swift/GAMBannerViewController.swift index 193b4f6..94bb730 100644 --- a/demo-ios-swift/demo-ios-swift/GAMBannerViewController.swift +++ b/demo-ios-swift/demo-ios-swift/GAMBannerViewController.swift @@ -22,7 +22,7 @@ class GAMBannerViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - bannerView = GADBannerView(adSize: kGADAdSizeBanner) + bannerView = GADBannerView(adSize: GADAdSizeBanner) addBannerViewToView(bannerView) bannerView.rootViewController = self } @@ -144,7 +144,7 @@ class GAMBannerViewController: UIViewController { NSLayoutConstraint(item: bannerView, attribute: .bottom, relatedBy: .equal, - toItem: bottomLayoutGuide, + toItem: view.safeAreaLayoutGuide.bottomAnchor, attribute: .top, multiplier: 1, constant: 0),