Skip to content

Commit 9b11e47

Browse files
Justin Malandruccolocopybara-github
Justin Malandruccolo
authored andcommitted
Swift 6 support for rewarded examples
PiperOrigin-RevId: 711785033
1 parent 47add97 commit 9b11e47

File tree

12 files changed

+24
-20
lines changed

12 files changed

+24
-20
lines changed

Swift/admanager/AdManagerRewardedInterstitialExample/AdManagerRewardedInterstitialExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
SUPPORTS_MACCATALYST = NO;
317317
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
318318
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
319-
SWIFT_VERSION = 5.0;
319+
SWIFT_VERSION = 6.0;
320320
TARGETED_DEVICE_FAMILY = "1,2";
321321
};
322322
name = Debug;
@@ -341,7 +341,7 @@
341341
SUPPORTS_MACCATALYST = NO;
342342
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
343343
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
344-
SWIFT_VERSION = 5.0;
344+
SWIFT_VERSION = 6.0;
345345
TARGETED_DEVICE_FAMILY = "1,2";
346346
};
347347
name = Release;

Swift/admanager/AdManagerRewardedInterstitialExample/AdManagerRewardedInterstitialExample/GameViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// limitations under the License.
1515
//
1616

17-
import GoogleMobileAds
17+
@preconcurrency import GoogleMobileAds
1818
import UIKit
1919

20-
class GameViewController: UIViewController, GADFullScreenContentDelegate {
20+
class GameViewController: UIViewController, @preconcurrency GADFullScreenContentDelegate {
2121

2222
private enum GameState: Int {
2323
case notStarted

Swift/admanager/AdManagerRewardedInterstitialExample/AdManagerRewardedInterstitialExample/GoogleMobileAdsConsentManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import UserMessagingPlatform
2323
/// consent for users in GDPR impacted countries. This is an example and
2424
/// you can choose another consent management platform to capture consent.
2525

26+
@MainActor
2627
class GoogleMobileAdsConsentManager: NSObject {
2728
static let shared = GoogleMobileAdsConsentManager()
2829

@@ -54,7 +55,7 @@ class GoogleMobileAdsConsentManager: NSObject {
5455
return consentGatheringComplete(requestConsentError)
5556
}
5657

57-
Task { @MainActor in
58+
Task {
5859
do {
5960
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
6061
// Consent has been gathered.

Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
284284
PRODUCT_NAME = AdManagerRewardedVideoExample;
285285
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
286-
SWIFT_VERSION = 5.0;
286+
SWIFT_VERSION = 6.0;
287287
};
288288
name = Debug;
289289
};
@@ -302,7 +302,7 @@
302302
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
303303
PRODUCT_NAME = AdManagerRewardedVideoExample;
304304
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
305-
SWIFT_VERSION = 5.0;
305+
SWIFT_VERSION = 6.0;
306306
};
307307
name = Release;
308308
};

Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/GoogleMobileAdsConsentManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import UserMessagingPlatform
2323
/// consent for users in GDPR impacted countries. This is an example and
2424
/// you can choose another consent management platform to capture consent.
2525

26+
@MainActor
2627
class GoogleMobileAdsConsentManager: NSObject {
2728
static let shared = GoogleMobileAdsConsentManager()
2829

@@ -54,7 +55,7 @@ class GoogleMobileAdsConsentManager: NSObject {
5455
return consentGatheringComplete(requestConsentError)
5556
}
5657

57-
Task { @MainActor in
58+
Task {
5859
do {
5960
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
6061
// Consent has been gathered.

Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// limitations under the License.
1515
//
1616

17-
import GoogleMobileAds
17+
@preconcurrency import GoogleMobileAds
1818
import UIKit
1919

20-
class ViewController: UIViewController, GADFullScreenContentDelegate {
20+
class ViewController: UIViewController, @preconcurrency GADFullScreenContentDelegate {
2121

2222
enum GameState: NSInteger {
2323
case notStarted

Swift/admob/RewardedInterstitialExample/RewardedInterstitialExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedInterstitialExample;
314314
PRODUCT_NAME = "$(TARGET_NAME)";
315315
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
316-
SWIFT_VERSION = 5.0;
316+
SWIFT_VERSION = 6.0;
317317
};
318318
name = Debug;
319319
};
@@ -334,7 +334,7 @@
334334
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedInterstitialExample;
335335
PRODUCT_NAME = "$(TARGET_NAME)";
336336
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
337-
SWIFT_VERSION = 5.0;
337+
SWIFT_VERSION = 6.0;
338338
};
339339
name = Release;
340340
};

Swift/admob/RewardedInterstitialExample/RewardedInterstitialExample/GameViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// limitations under the License.
1515
//
1616

17-
import GoogleMobileAds
17+
@preconcurrency import GoogleMobileAds
1818
import UIKit
1919

20-
class GameViewController: UIViewController, GADFullScreenContentDelegate {
20+
class GameViewController: UIViewController, @preconcurrency GADFullScreenContentDelegate {
2121

2222
private enum GameState: Int {
2323
case notStarted

Swift/admob/RewardedInterstitialExample/RewardedInterstitialExample/GoogleMobileAdsConsentManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import UserMessagingPlatform
2323
/// consent for users in GDPR impacted countries. This is an example and
2424
/// you can choose another consent management platform to capture consent.
2525

26+
@MainActor
2627
class GoogleMobileAdsConsentManager: NSObject {
2728
static let shared = GoogleMobileAdsConsentManager()
2829

@@ -54,7 +55,7 @@ class GoogleMobileAdsConsentManager: NSObject {
5455
return consentGatheringComplete(requestConsentError)
5556
}
5657

57-
Task { @MainActor in
58+
Task {
5859
do {
5960
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
6061
// Consent has been gathered.

Swift/admob/RewardedVideoExample/RewardedVideoExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
292292
PRODUCT_NAME = RewardedVideoExample;
293293
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
294-
SWIFT_VERSION = 5.0;
294+
SWIFT_VERSION = 6.0;
295295
};
296296
name = Debug;
297297
};
@@ -310,7 +310,7 @@
310310
PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample;
311311
PRODUCT_NAME = RewardedVideoExample;
312312
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
313-
SWIFT_VERSION = 5.0;
313+
SWIFT_VERSION = 6.0;
314314
};
315315
name = Release;
316316
};

Swift/admob/RewardedVideoExample/RewardedVideoExample/GoogleMobileAdsConsentManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import UserMessagingPlatform
2323
/// consent for users in GDPR impacted countries. This is an example and
2424
/// you can choose another consent management platform to capture consent.
2525

26+
@MainActor
2627
class GoogleMobileAdsConsentManager: NSObject {
2728
static let shared = GoogleMobileAdsConsentManager()
2829

@@ -54,7 +55,7 @@ class GoogleMobileAdsConsentManager: NSObject {
5455
return consentGatheringComplete(requestConsentError)
5556
}
5657

57-
Task { @MainActor in
58+
Task {
5859
do {
5960
try await UMPConsentForm.loadAndPresentIfRequired(from: viewController)
6061
// Consent has been gathered.

Swift/admob/RewardedVideoExample/RewardedVideoExample/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// limitations under the License.
1515
//
1616

17-
import GoogleMobileAds
17+
@preconcurrency import GoogleMobileAds
1818
import UIKit
1919

20-
class ViewController: UIViewController, GADFullScreenContentDelegate {
20+
class ViewController: UIViewController, @preconcurrency GADFullScreenContentDelegate {
2121

2222
enum GameState: NSInteger {
2323
case notStarted

0 commit comments

Comments
 (0)