Skip to content

Commit

Permalink
Swift 6 support for Banner examples
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 709074802
  • Loading branch information
Justin Malandruccolo authored and copybara-github committed Dec 26, 2024
1 parent 1e19404 commit 7c704ff
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -306,7 +306,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import UserMessagingPlatform
/// consent for users in GDPR impacted countries. This is an example and
/// you can choose another consent management platform to capture consent.

@MainActor
class GoogleMobileAdsConsentManager: NSObject {
static let shared = GoogleMobileAdsConsentManager()

Expand Down Expand Up @@ -54,7 +55,7 @@ class GoogleMobileAdsConsentManager: NSObject {
return consentGatheringComplete(requestConsentError)
}

Task { @MainActor in
Task {
do {
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
// Consent has been gathered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADBannerViewDelegate {
class ViewController: UIViewController, @preconcurrency GADBannerViewDelegate {
@IBOutlet weak var bannerView: GAMBannerView!
@IBOutlet weak var privacySettingsButton: UIBarButtonItem!
@IBOutlet weak var adInspectorButton: UIBarButtonItem!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.BannerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -311,7 +311,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.BannerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import UserMessagingPlatform
/// consent for users in GDPR impacted countries. This is an example and
/// you can choose another consent management platform to capture consent.

@MainActor
class GoogleMobileAdsConsentManager: NSObject {
static let shared = GoogleMobileAdsConsentManager()

Expand Down Expand Up @@ -58,7 +59,7 @@ class GoogleMobileAdsConsentManager: NSObject {
return consentGatheringComplete(requestConsentError)
}

Task { @MainActor in
Task {
do {
// [START load_and_present_consent_form]
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADBannerViewDelegate {
class ViewController: UIViewController, @preconcurrency GADBannerViewDelegate {

@IBOutlet weak var bannerView: GADBannerView!
@IBOutlet weak var privacySettingsButton: UIBarButtonItem!
Expand Down

0 comments on commit 7c704ff

Please sign in to comment.