From 96bc117e24763e589a3a936af1c64590e77c2502 Mon Sep 17 00:00:00 2001 From: Osei Fortune Date: Wed, 21 May 2025 16:35:28 -0400 Subject: [PATCH] fix(google-mobile-ads): adLoader --- .../google-mobile-ads/nativead/index.ios.ts | 4 +--- .../platforms/ios/src/TNSGA.swift | 19 ++++++++++--------- .../google-mobile-ads/typings/objc!TNSGA.d.ts | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/google-mobile-ads/nativead/index.ios.ts b/packages/google-mobile-ads/nativead/index.ios.ts index e6bab5bb..4734473f 100644 --- a/packages/google-mobile-ads/nativead/index.ios.ts +++ b/packages/google-mobile-ads/nativead/index.ios.ts @@ -6,8 +6,6 @@ import { ManagerRequestOptions, RequestOptions, AdEventListener } from '..'; import { NativeAdEventListener, NativeAdViewBase, MediaViewBase, mediaContentProperty, stretchProperty, MediaAspectRatio, AdChoicesPlacement, VideoStatus, NativeAdEventType } from './common'; import { IMediaContent, IMuteThisAdReason, INativeAd, INativeAdImage, IVideoController, NativeAdOptions, UnconfirmedClickListener, INativeAdLoader } from '.'; -declare const AdLoaderAdType; - export { AdChoicesPlacement, AdEventType, VideoStatus, MediaAspectRatio, NativeAdEventType }; export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilder { @@ -262,7 +260,7 @@ export class NativeAdLoader implements INativeAdLoader { options.push(numberOfAds); } - this._native = GADAdLoader.alloc().initWithAdUnitIDRootViewControllerAdTypesOptions(this._adUnitId, topViewController(), [TNSGA.AdLoaderAdTypeToString(AdLoaderAdType.Native)], options); + this._native = GADAdLoader.alloc().initWithAdUnitIDRootViewControllerAdTypesOptions(this._adUnitId, topViewController(), [TNSGA.AdLoaderAdTypeToString(NSCAdLoaderAdType.Native)], options); this._native.delegate = this._delegate; if (arg) { diff --git a/packages/google-mobile-ads/platforms/ios/src/TNSGA.swift b/packages/google-mobile-ads/platforms/ios/src/TNSGA.swift index 940d0594..9643b9c0 100644 --- a/packages/google-mobile-ads/platforms/ios/src/TNSGA.swift +++ b/packages/google-mobile-ads/platforms/ios/src/TNSGA.swift @@ -38,8 +38,8 @@ public class TNSGA:NSObject { } - @objc(AdLoaderAdType) - public enum AdLoaderAdType: Int, RawRepresentable { + @objc(NSCAdLoaderAdType) + public enum NSCAdLoaderAdType: Int, RawRepresentable { case CustomNative case GAMBanner case Native @@ -47,11 +47,12 @@ public class TNSGA:NSObject { public init?(rawValue: String) { switch rawValue { - case AdLoaderAdType.CustomNative.rawValue: + + case AdLoaderAdType.customNative.rawValue: self = .CustomNative - case AdLoaderAdType.GAMBanner.rawValue: + case AdLoaderAdType.adManagerBanner.rawValue: self = .GAMBanner - case AdLoaderAdType.Native.rawValue: + case AdLoaderAdType.native.rawValue: self = .Native default: return nil @@ -61,16 +62,16 @@ public class TNSGA:NSObject { public var rawValue: RawValue { switch self { case .CustomNative: - return AdLoaderAdType.CustomNative.rawValue + return AdLoaderAdType.customNative.rawValue case .GAMBanner: - return AdLoaderAdType.GAMBanner.rawValue + return AdLoaderAdType.adManagerBanner.rawValue case .Native: - return AdLoaderAdType.Native.rawValue + return AdLoaderAdType.native.rawValue } } } - public static func AdLoaderAdTypeToString(_ type: AdLoaderAdType) -> String { + public static func AdLoaderAdTypeToString(_ type: NSCAdLoaderAdType) -> String { return type.rawValue } diff --git a/packages/google-mobile-ads/typings/objc!TNSGA.d.ts b/packages/google-mobile-ads/typings/objc!TNSGA.d.ts index 0d7c10aa..2ff395d2 100644 --- a/packages/google-mobile-ads/typings/objc!TNSGA.d.ts +++ b/packages/google-mobile-ads/typings/objc!TNSGA.d.ts @@ -16,7 +16,7 @@ declare const enum NSCGABannersSize { Invalid = 7, } -declare const enum AdLoaderAdType { +declare const enum NSCAdLoaderAdType { CustomNative = 0, GAMBanner = 1, @@ -39,7 +39,7 @@ declare class TNSGA extends NSObject { static createInlineAdaptiveBanner(width: number, maxHeight: number, orientation: Orientation): GADAdSize; - static AdLoaderAdTypeToString(type: AdLoaderAdType): string; + static AdLoaderAdTypeToString(type: NSCAdLoaderAdType): string; static new(): TNSGA; // inherited from NSObject