Skip to content

Commit

Permalink
Swift 6 support for interstitial examples
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 711776489
  • Loading branch information
Justin Malandruccolo authored and copybara-github committed Jan 3, 2025
1 parent b756519 commit 47add97
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,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 @@ -304,7 +304,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 @@ -14,10 +14,10 @@
// limitations under the License.
//

import GoogleMobileAds
@preconcurrency import GoogleMobileAds
import UIKit

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

enum GameState: NSInteger {
case notStarted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,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 @@ -312,7 +312,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 @@ -14,10 +14,10 @@
// limitations under the License.
//

import GoogleMobileAds
@preconcurrency import GoogleMobileAds
import UIKit

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

enum GameState: NSInteger {
case notStarted
Expand Down

0 comments on commit 47add97

Please sign in to comment.