Skip to content

Commit

Permalink
Swift 6 support for rewarded examples
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 712554834
  • Loading branch information
Justin Malandruccolo authored and copybara-github committed Jan 6, 2025
1 parent 47add97 commit 7d9f809
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -341,7 +341,7 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
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 GameViewController: UIViewController, GADFullScreenContentDelegate {
class GameViewController: UIViewController, @preconcurrency GADFullScreenContentDelegate {

private enum GameState: Int {
case notStarted
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 @@ -283,7 +283,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
PRODUCT_NAME = AdManagerRewardedVideoExample;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -302,7 +302,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
PRODUCT_NAME = AdManagerRewardedVideoExample;
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 @@ -313,7 +313,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedInterstitialExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -334,7 +334,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedInterstitialExample;
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 @@ -14,10 +14,10 @@
// limitations under the License.
//

import GoogleMobileAds
@preconcurrency import GoogleMobileAds
import UIKit

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

private enum GameState: Int {
case notStarted
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 @@ -291,7 +291,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
PRODUCT_NAME = RewardedVideoExample;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -310,7 +310,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
PRODUCT_NAME = RewardedVideoExample;
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 7d9f809

Please sign in to comment.