Skip to content

Commit 991b368

Browse files
authored
fix(google-mobile-ads): adLoader (#626)
1 parent 0be461a commit 991b368

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

packages/google-mobile-ads/nativead/index.ios.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { ManagerRequestOptions, RequestOptions, AdEventListener } from '..';
66
import { NativeAdEventListener, NativeAdViewBase, MediaViewBase, mediaContentProperty, stretchProperty, MediaAspectRatio, AdChoicesPlacement, VideoStatus, NativeAdEventType } from './common';
77
import { IMediaContent, IMuteThisAdReason, INativeAd, INativeAdImage, IVideoController, NativeAdOptions, UnconfirmedClickListener, INativeAdLoader } from '.';
88

9-
declare const AdLoaderAdType;
10-
119
export { AdChoicesPlacement, AdEventType, VideoStatus, MediaAspectRatio, NativeAdEventType };
1210

1311
export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilder {
@@ -262,7 +260,7 @@ export class NativeAdLoader implements INativeAdLoader {
262260
options.push(numberOfAds);
263261
}
264262

265-
this._native = GADAdLoader.alloc().initWithAdUnitIDRootViewControllerAdTypesOptions(this._adUnitId, topViewController(), [TNSGA.AdLoaderAdTypeToString(AdLoaderAdType.Native)], options);
263+
this._native = GADAdLoader.alloc().initWithAdUnitIDRootViewControllerAdTypesOptions(this._adUnitId, topViewController(), [TNSGA.AdLoaderAdTypeToString(NSCAdLoaderAdType.Native)], options);
266264
this._native.delegate = this._delegate;
267265

268266
if (arg) {

packages/google-mobile-ads/platforms/ios/src/TNSGA.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@ public class TNSGA:NSObject {
3838
}
3939

4040

41-
@objc(AdLoaderAdType)
42-
public enum AdLoaderAdType: Int, RawRepresentable {
41+
@objc(NSCAdLoaderAdType)
42+
public enum NSCAdLoaderAdType: Int, RawRepresentable {
4343
case CustomNative
4444
case GAMBanner
4545
case Native
4646
public typealias RawValue = String
4747

4848
public init?(rawValue: String) {
4949
switch rawValue {
50-
case AdLoaderAdType.CustomNative.rawValue:
50+
51+
case AdLoaderAdType.customNative.rawValue:
5152
self = .CustomNative
52-
case AdLoaderAdType.GAMBanner.rawValue:
53+
case AdLoaderAdType.adManagerBanner.rawValue:
5354
self = .GAMBanner
54-
case AdLoaderAdType.Native.rawValue:
55+
case AdLoaderAdType.native.rawValue:
5556
self = .Native
5657
default:
5758
return nil
@@ -61,16 +62,16 @@ public class TNSGA:NSObject {
6162
public var rawValue: RawValue {
6263
switch self {
6364
case .CustomNative:
64-
return AdLoaderAdType.CustomNative.rawValue
65+
return AdLoaderAdType.customNative.rawValue
6566
case .GAMBanner:
66-
return AdLoaderAdType.GAMBanner.rawValue
67+
return AdLoaderAdType.adManagerBanner.rawValue
6768
case .Native:
68-
return AdLoaderAdType.Native.rawValue
69+
return AdLoaderAdType.native.rawValue
6970
}
7071
}
7172
}
7273

73-
public static func AdLoaderAdTypeToString(_ type: AdLoaderAdType) -> String {
74+
public static func AdLoaderAdTypeToString(_ type: NSCAdLoaderAdType) -> String {
7475
return type.rawValue
7576
}
7677

packages/google-mobile-ads/typings/objc!TNSGA.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare const enum NSCGABannersSize {
1616
Invalid = 7,
1717
}
1818

19-
declare const enum AdLoaderAdType {
19+
declare const enum NSCAdLoaderAdType {
2020
CustomNative = 0,
2121

2222
GAMBanner = 1,
@@ -39,7 +39,7 @@ declare class TNSGA extends NSObject {
3939

4040
static createInlineAdaptiveBanner(width: number, maxHeight: number, orientation: Orientation): GADAdSize;
4141

42-
static AdLoaderAdTypeToString(type: AdLoaderAdType): string;
42+
static AdLoaderAdTypeToString(type: NSCAdLoaderAdType): string;
4343

4444
static new(): TNSGA; // inherited from NSObject
4545

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy