Skip to content

Commit

Permalink
Swift 6 adoption in Native Swift sample
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 705509027
  • Loading branch information
Justin Malandruccolo authored and copybara-github committed Dec 12, 2024
1 parent 1e7daef commit 1b894e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.NativeAdvancedExample;
PRODUCT_NAME = NativeAdvancedExample;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -314,7 +314,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.NativeAdvancedExample;
PRODUCT_NAME = NativeAdvancedExample;
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 @@ -22,7 +22,7 @@ import UserMessagingPlatform
/// IAB Certified consent management platform) as one solution to capture
/// 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 +54,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 @@ -192,21 +192,21 @@ class ViewController: UIViewController {
}
}

extension ViewController: GADVideoControllerDelegate {
extension ViewController: @preconcurrency GADVideoControllerDelegate {

func videoControllerDidEndVideoPlayback(_ videoController: GADVideoController) {
videoStatusLabel.text = "Video playback has ended."
}
}

extension ViewController: GADAdLoaderDelegate {
extension ViewController: @preconcurrency GADAdLoaderDelegate {
func adLoader(_ adLoader: GADAdLoader, didFailToReceiveAdWithError error: Error) {
print("\(adLoader) failed with error: \(error.localizedDescription)")
refreshAdButton.isEnabled = true
}
}

extension ViewController: GADNativeAdLoaderDelegate {
extension ViewController: @preconcurrency GADNativeAdLoaderDelegate {

func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADNativeAd) {
refreshAdButton.isEnabled = true
Expand Down Expand Up @@ -284,7 +284,7 @@ extension ViewController: GADNativeAdLoaderDelegate {
}

// MARK: - GADNativeAdDelegate implementation
extension ViewController: GADNativeAdDelegate {
extension ViewController: @preconcurrency GADNativeAdDelegate {

func nativeAdDidRecordClick(_ nativeAd: GADNativeAd) {
print("\(#function) called")
Expand Down

0 comments on commit 1b894e6

Please sign in to comment.