react-native-google-mobile-ads 11.1.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/RNGoogleMobileAds.podspec +6 -2
- package/__tests__/banner.test.tsx +10 -0
- package/__tests__/googleMobileAds.test.ts +21 -0
- package/__tests__/interstitial.test.ts +22 -8
- package/android/build.gradle +8 -0
- package/android/src/main/java/io/invertase/googlemobileads/OnNativeEvent.kt +21 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +21 -9
- package/android/src/main/java/io/invertase/googlemobileads/common/SharedUtils.java +17 -15
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.swift +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerComponent.h +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerComponent.m +11 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.h +30 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +220 -0
- package/ios/RNGoogleMobileAds/{RNGoogleMobileAdsBannerViewManager.m → RNGoogleMobileAdsBannerViewManager.mm} +19 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +5 -1
- package/ios/RNGoogleMobileAds/{RNGoogleMobileAdsCommon.m → RNGoogleMobileAdsCommon.mm} +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +13 -1
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.swift +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.swift +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.swift +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.h +9 -1
- package/ios/RNGoogleMobileAds/{RNGoogleMobileAdsModule.m → RNGoogleMobileAdsModule.mm} +52 -21
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.m +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.swift +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +4 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.swift +4 -0
- package/jest.setup.ts +12 -1
- package/lib/commonjs/MobileAds.js +26 -31
- package/lib/commonjs/MobileAds.js.map +1 -1
- package/lib/commonjs/NativeGoogleMobileAdsModule.js +10 -0
- package/lib/commonjs/NativeGoogleMobileAdsModule.js.map +1 -0
- package/lib/commonjs/ads/AppOpenAd.js +1 -2
- package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
- package/lib/commonjs/ads/BaseAd.js +11 -13
- package/lib/commonjs/ads/BaseAd.js.map +1 -1
- package/lib/commonjs/ads/GAMBannerAd.js +3 -5
- package/lib/commonjs/ads/GAMBannerAd.js.map +1 -1
- package/lib/commonjs/ads/GoogleMobileAdsBannerViewNativeComponent.js +16 -0
- package/lib/commonjs/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
- package/lib/commonjs/ads/InterstitialAd.js +1 -2
- package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
- package/lib/commonjs/ads/MobileAd.js +8 -6
- package/lib/commonjs/ads/MobileAd.js.map +1 -1
- package/lib/commonjs/ads/RewardedAd.js +1 -2
- package/lib/commonjs/ads/RewardedAd.js.map +1 -1
- package/lib/commonjs/ads/RewardedInterstitialAd.js +1 -2
- package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -1
- package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/MobileAds.js +25 -31
- package/lib/module/MobileAds.js.map +1 -1
- package/lib/module/NativeGoogleMobileAdsModule.js +3 -0
- package/lib/module/NativeGoogleMobileAdsModule.js.map +1 -0
- package/lib/module/ads/AppOpenAd.js +1 -2
- package/lib/module/ads/AppOpenAd.js.map +1 -1
- package/lib/module/ads/BaseAd.js +9 -12
- package/lib/module/ads/BaseAd.js.map +1 -1
- package/lib/module/ads/GAMBannerAd.js +3 -5
- package/lib/module/ads/GAMBannerAd.js.map +1 -1
- package/lib/module/ads/GoogleMobileAdsBannerViewNativeComponent.js +7 -0
- package/lib/module/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
- package/lib/module/ads/InterstitialAd.js +1 -2
- package/lib/module/ads/InterstitialAd.js.map +1 -1
- package/lib/module/ads/MobileAd.js +8 -6
- package/lib/module/ads/MobileAd.js.map +1 -1
- package/lib/module/ads/RewardedAd.js +1 -2
- package/lib/module/ads/RewardedAd.js.map +1 -1
- package/lib/module/ads/RewardedInterstitialAd.js +1 -2
- package/lib/module/ads/RewardedInterstitialAd.js.map +1 -1
- package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/MobileAds.d.ts +3 -4
- package/lib/typescript/MobileAds.d.ts.map +1 -1
- package/lib/typescript/NativeGoogleMobileAdsModule.d.ts +12 -0
- package/lib/typescript/NativeGoogleMobileAdsModule.d.ts.map +1 -0
- package/lib/typescript/ads/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/ads/BaseAd.d.ts +1 -33
- package/lib/typescript/ads/BaseAd.d.ts.map +1 -1
- package/lib/typescript/ads/GAMBannerAd.d.ts.map +1 -1
- package/lib/typescript/ads/GoogleMobileAdsBannerViewNativeComponent.d.ts +27 -0
- package/lib/typescript/ads/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/ads/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/ads/MobileAd.d.ts +6 -5
- package/lib/typescript/ads/MobileAd.d.ts.map +1 -1
- package/lib/typescript/ads/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/ads/RewardedInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts +2 -1
- package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts.map +1 -1
- package/lib/typescript/types/MobileAdsModule.interface.d.ts +0 -10
- package/lib/typescript/types/MobileAdsModule.interface.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +9 -1
- package/src/MobileAds.ts +29 -62
- package/src/NativeGoogleMobileAdsModule.ts +14 -0
- package/src/ads/AppOpenAd.ts +7 -2
- package/src/ads/BaseAd.tsx +101 -116
- package/src/ads/GAMBannerAd.tsx +5 -8
- package/src/ads/GoogleMobileAdsBannerViewNativeComponent.ts +37 -0
- package/src/ads/InterstitialAd.ts +7 -2
- package/src/ads/MobileAd.ts +22 -10
- package/src/ads/RewardedAd.ts +7 -2
- package/src/ads/RewardedInterstitialAd.ts +1 -2
- package/src/internal/GoogleMobileAdsNativeEventEmitter.ts +1 -1
- package/src/types/MobileAdsModule.interface.ts +0 -13
- package/src/version.ts +1 -1
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.h +0 -23
- package/lib/commonjs/internal/Module.js +0 -44
- package/lib/commonjs/internal/Module.js.map +0 -1
- package/lib/commonjs/internal/index.js +0 -44
- package/lib/commonjs/internal/index.js.map +0 -1
- package/lib/commonjs/internal/registry/nativeModule.js +0 -180
- package/lib/commonjs/internal/registry/nativeModule.js.map +0 -1
- package/lib/commonjs/types/GoogleMobileAdsNativeModule.js +0 -6
- package/lib/commonjs/types/GoogleMobileAdsNativeModule.js.map +0 -1
- package/lib/commonjs/types/Module.interface.js +0 -2
- package/lib/commonjs/types/Module.interface.js.map +0 -1
- package/lib/module/internal/Module.js +0 -54
- package/lib/module/internal/Module.js.map +0 -1
- package/lib/module/internal/index.js +0 -22
- package/lib/module/internal/index.js.map +0 -1
- package/lib/module/internal/registry/nativeModule.js +0 -174
- package/lib/module/internal/registry/nativeModule.js.map +0 -1
- package/lib/module/types/GoogleMobileAdsNativeModule.js +0 -2
- package/lib/module/types/GoogleMobileAdsNativeModule.js.map +0 -1
- package/lib/module/types/Module.interface.js +0 -2
- package/lib/module/types/Module.interface.js.map +0 -1
- package/lib/typescript/internal/Module.d.ts +0 -14
- package/lib/typescript/internal/Module.d.ts.map +0 -1
- package/lib/typescript/internal/index.d.ts +0 -5
- package/lib/typescript/internal/index.d.ts.map +0 -1
- package/lib/typescript/internal/registry/nativeModule.d.ts +0 -10
- package/lib/typescript/internal/registry/nativeModule.d.ts.map +0 -1
- package/lib/typescript/types/GoogleMobileAdsNativeModule.d.ts +0 -22
- package/lib/typescript/types/GoogleMobileAdsNativeModule.d.ts.map +0 -1
- package/lib/typescript/types/Module.interface.d.ts +0 -15
- package/lib/typescript/types/Module.interface.d.ts.map +0 -1
- package/src/internal/Module.ts +0 -58
- package/src/internal/index.ts +0 -21
- package/src/internal/registry/nativeModule.ts +0 -205
- package/src/types/GoogleMobileAdsNativeModule.ts +0 -26
- package/src/types/Module.interface.ts +0 -16
|
@@ -16,9 +16,16 @@
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
#import "RNGoogleMobileAdsBannerViewManager.h"
|
|
20
19
|
#import <React/RCTUIManager.h>
|
|
20
|
+
#import <React/RCTViewManager.h>
|
|
21
|
+
#ifdef RCT_NEW_ARCH_ENABLE
|
|
22
|
+
|
|
23
|
+
#else
|
|
21
24
|
#import "RNGoogleMobileAdsBannerComponent.h"
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
@interface RNGoogleMobileAdsBannerViewManager : RCTViewManager
|
|
28
|
+
@end
|
|
22
29
|
|
|
23
30
|
@implementation RNGoogleMobileAdsBannerViewManager
|
|
24
31
|
|
|
@@ -28,13 +35,14 @@ RCT_EXPORT_VIEW_PROPERTY(sizes, NSArray);
|
|
|
28
35
|
|
|
29
36
|
RCT_EXPORT_VIEW_PROPERTY(unitId, NSString);
|
|
30
37
|
|
|
31
|
-
RCT_EXPORT_VIEW_PROPERTY(request,
|
|
38
|
+
RCT_EXPORT_VIEW_PROPERTY(request, NSString);
|
|
32
39
|
|
|
33
40
|
RCT_EXPORT_VIEW_PROPERTY(manualImpressionsEnabled, BOOL);
|
|
34
41
|
|
|
35
42
|
RCT_EXPORT_VIEW_PROPERTY(onNativeEvent, RCTBubblingEventBlock);
|
|
36
43
|
|
|
37
44
|
RCT_EXPORT_METHOD(recordManualImpression : (nonnull NSNumber *)reactTag) {
|
|
45
|
+
#if !TARGET_OS_MACCATALYST
|
|
38
46
|
[self.bridge.uiManager
|
|
39
47
|
addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
40
48
|
RNGoogleMobileAdsBannerComponent *banner = viewRegistry[reactTag];
|
|
@@ -44,17 +52,26 @@ RCT_EXPORT_METHOD(recordManualImpression : (nonnull NSNumber *)reactTag) {
|
|
|
44
52
|
}
|
|
45
53
|
[banner recordManualImpression];
|
|
46
54
|
}];
|
|
55
|
+
#endif
|
|
47
56
|
}
|
|
48
57
|
|
|
58
|
+
#ifdef RCT_NEW_ARCH_ENABLE
|
|
59
|
+
|
|
60
|
+
#else
|
|
49
61
|
@synthesize bridge = _bridge;
|
|
50
62
|
|
|
51
63
|
- (UIView *)view {
|
|
64
|
+
#if TARGET_OS_MACCATALYST
|
|
65
|
+
return nil;
|
|
66
|
+
#else
|
|
52
67
|
RNGoogleMobileAdsBannerComponent *banner = [RNGoogleMobileAdsBannerComponent new];
|
|
53
68
|
return banner;
|
|
69
|
+
#endif
|
|
54
70
|
}
|
|
55
71
|
|
|
56
72
|
- (dispatch_queue_t)methodQueue {
|
|
57
73
|
return dispatch_get_main_queue();
|
|
58
74
|
}
|
|
75
|
+
#endif
|
|
59
76
|
|
|
60
77
|
@end
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
#if !TARGET_OS_MACCATALYST
|
|
20
|
+
|
|
21
|
+
#import <GoogleMobileAds/GoogleMobileAds.h>
|
|
19
22
|
#import <React/RCTBridgeModule.h>
|
|
20
|
-
@import GoogleMobileAds;
|
|
21
23
|
|
|
22
24
|
@interface RNGoogleMobileAdsCommon : NSObject
|
|
23
25
|
|
|
@@ -64,3 +66,5 @@ extern NSString *const GOOGLE_MOBILE_ADS_EVENT_APP_EVENT;
|
|
|
64
66
|
|
|
65
67
|
extern NSString *const GOOGLE_MOBILE_ADS_EVENT_REWARDED_LOADED;
|
|
66
68
|
extern NSString *const GOOGLE_MOBILE_ADS_EVENT_REWARDED_EARNED_REWARD;
|
|
69
|
+
|
|
70
|
+
#endif
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
#if !TARGET_OS_MACCATALYST
|
|
20
|
+
|
|
19
21
|
#import "RNGoogleMobileAdsCommon.h"
|
|
20
22
|
#import "common/RNRCTEventEmitter.h"
|
|
21
23
|
|
|
@@ -231,3 +233,5 @@ NSString *const GOOGLE_MOBILE_ADS_EVENT_REWARDED_EARNED_REWARD = @"rewarded_earn
|
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
@end
|
|
236
|
+
|
|
237
|
+
#endif
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
#import <React/RCTUtils.h>
|
|
20
20
|
|
|
21
21
|
#import <React/RCTConvert.h>
|
|
22
|
+
#if !TARGET_OS_MACCATALYST
|
|
22
23
|
#include <UserMessagingPlatform/UserMessagingPlatform.h>
|
|
24
|
+
#endif
|
|
23
25
|
#import "RCTBridgeModule.h"
|
|
24
26
|
#import "RNGoogleMobileAdsConsentModule.h"
|
|
25
27
|
#import "common/RNSharedUtils.h"
|
|
@@ -37,6 +39,7 @@ RCT_EXPORT_MODULE();
|
|
|
37
39
|
#pragma mark -
|
|
38
40
|
#pragma mark Google Mobile Ads Methods
|
|
39
41
|
|
|
42
|
+
#if !TARGET_OS_MACCATALYST
|
|
40
43
|
- (NSString *)getConsentStatusString:(UMPConsentStatus)consentStatus {
|
|
41
44
|
switch (consentStatus) {
|
|
42
45
|
case UMPConsentStatusRequired:
|
|
@@ -50,11 +53,13 @@ RCT_EXPORT_MODULE();
|
|
|
50
53
|
return @"UNKNOWN";
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
#endif
|
|
53
57
|
|
|
54
58
|
RCT_EXPORT_METHOD(requestInfoUpdate
|
|
55
59
|
: (NSDictionary *)options
|
|
56
60
|
: (RCTPromiseResolveBlock)resolve
|
|
57
61
|
: (RCTPromiseRejectBlock)reject) {
|
|
62
|
+
#if !TARGET_OS_MACCATALYST
|
|
58
63
|
UMPRequestParameters *parameters = [[UMPRequestParameters alloc] init];
|
|
59
64
|
UMPDebugSettings *debugSettings = [[UMPDebugSettings alloc] init];
|
|
60
65
|
|
|
@@ -86,9 +91,11 @@ RCT_EXPORT_METHOD(requestInfoUpdate
|
|
|
86
91
|
});
|
|
87
92
|
}
|
|
88
93
|
}];
|
|
94
|
+
#endif
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
RCT_EXPORT_METHOD(showForm : (RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) {
|
|
98
|
+
#if !TARGET_OS_MACCATALYST
|
|
92
99
|
[UMPConsentForm loadWithCompletionHandler:^(UMPConsentForm *form, NSError *loadError) {
|
|
93
100
|
if (loadError) {
|
|
94
101
|
[RNSharedUtils rejectPromiseWithUserInfo:reject
|
|
@@ -117,9 +124,14 @@ RCT_EXPORT_METHOD(showForm : (RCTPromiseResolveBlock)resolve : (RCTPromiseReject
|
|
|
117
124
|
}];
|
|
118
125
|
}
|
|
119
126
|
}];
|
|
127
|
+
#endif
|
|
120
128
|
}
|
|
121
129
|
|
|
122
|
-
RCT_EXPORT_METHOD(reset) {
|
|
130
|
+
RCT_EXPORT_METHOD(reset) {
|
|
131
|
+
#if !TARGET_OS_MACCATALYST
|
|
132
|
+
[UMPConsentInformation.sharedInstance reset];
|
|
133
|
+
#endif
|
|
134
|
+
}
|
|
123
135
|
|
|
124
136
|
RCT_EXPORT_METHOD(getTCString : (RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) {
|
|
125
137
|
@try {
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
#if !targetEnvironment(macCatalyst)
|
|
19
|
+
|
|
18
20
|
import Foundation
|
|
19
21
|
import GoogleMobileAds
|
|
20
22
|
|
|
@@ -206,3 +208,5 @@ class RNGoogleMobileAdsFullScreenAd<T>: NSObject where T : GADFullScreenPresenti
|
|
|
206
208
|
resolve!(nil)
|
|
207
209
|
}
|
|
208
210
|
}
|
|
211
|
+
|
|
212
|
+
#endif
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
#if !TARGET_OS_MACCATALYST
|
|
19
|
+
|
|
18
20
|
#import <React/RCTBridgeModule.h>
|
|
19
21
|
|
|
20
22
|
@interface RCT_EXTERN_MODULE (RNGoogleMobileAdsInterstitialModule, NSObject)
|
|
@@ -40,3 +42,5 @@ RCT_EXTERN_METHOD(interstitialShow
|
|
|
40
42
|
: (RCTPromiseRejectBlock)reject)
|
|
41
43
|
|
|
42
44
|
@end
|
|
45
|
+
|
|
46
|
+
#endif
|
|
@@ -17,8 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
#import <Foundation/Foundation.h>
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
21
|
+
|
|
22
|
+
#import <RNGoogleMobileAdsSpec/RNGoogleMobileAdsSpec.h>
|
|
23
|
+
@interface RNGoogleMobileAdsModule : NSObject <NativeGoogleMobileAdsModuleSpec>
|
|
24
|
+
|
|
25
|
+
#else
|
|
21
26
|
|
|
27
|
+
#import <React/RCTBridgeModule.h>
|
|
22
28
|
@interface RNGoogleMobileAdsModule : NSObject <RCTBridgeModule>
|
|
23
29
|
|
|
30
|
+
#endif
|
|
31
|
+
|
|
24
32
|
@end
|
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
#if !TARGET_OS_MACCATALYST
|
|
18
19
|
#import <GoogleMobileAds/GoogleMobileAds.h>
|
|
20
|
+
#endif
|
|
19
21
|
#import <React/RCTUtils.h>
|
|
20
22
|
|
|
21
23
|
#import "RNGoogleMobileAdsModule.h"
|
|
24
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
25
|
+
#import "RNGoogleMobileAdsSpec.h"
|
|
26
|
+
#endif
|
|
22
27
|
#import "common/RNSharedUtils.h"
|
|
23
28
|
|
|
24
29
|
@implementation RNGoogleMobileAdsModule
|
|
@@ -35,6 +40,42 @@ RCT_EXPORT_MODULE();
|
|
|
35
40
|
#pragma mark Google Mobile Ads Methods
|
|
36
41
|
|
|
37
42
|
RCT_EXPORT_METHOD(initialize : (RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) {
|
|
43
|
+
[self initialize:resolve reject:reject];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
RCT_EXPORT_METHOD(setRequestConfiguration
|
|
47
|
+
: (NSDictionary *)requestConfiguration
|
|
48
|
+
: (RCTPromiseResolveBlock)resolve
|
|
49
|
+
: (RCTPromiseRejectBlock)reject) {
|
|
50
|
+
[self setRequestConfiguration:requestConfiguration resolve:resolve reject:reject];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
RCT_EXPORT_METHOD(openAdInspector
|
|
54
|
+
: (RCTPromiseResolveBlock)resolve
|
|
55
|
+
: (RCTPromiseRejectBlock)reject) {
|
|
56
|
+
[self openAdInspector:resolve reject:reject];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
RCT_EXPORT_METHOD(openDebugMenu : (NSString *)adUnit) {
|
|
60
|
+
#if !TARGET_OS_MACCATALYST
|
|
61
|
+
GADDebugOptionsViewController *debugOptionsViewController =
|
|
62
|
+
[GADDebugOptionsViewController debugOptionsViewControllerWithAdUnitID:adUnit];
|
|
63
|
+
[RCTSharedApplication().delegate.window.rootViewController
|
|
64
|
+
presentViewController:debugOptionsViewController
|
|
65
|
+
animated:YES
|
|
66
|
+
completion:nil];
|
|
67
|
+
#endif
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
71
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
72
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
73
|
+
return std::make_shared<facebook::react::NativeGoogleMobileAdsModuleSpecJSI>(params);
|
|
74
|
+
}
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
- (void)initialize:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
78
|
+
#if !TARGET_OS_MACCATALYST
|
|
38
79
|
[[GADMobileAds sharedInstance]
|
|
39
80
|
startWithCompletionHandler:^(GADInitializationStatus *_Nonnull status) {
|
|
40
81
|
NSDictionary *adapterStatuses = [status adapterStatusesByClassName];
|
|
@@ -50,17 +91,13 @@ RCT_EXPORT_METHOD(initialize : (RCTPromiseResolveBlock)resolve : (RCTPromiseReje
|
|
|
50
91
|
}
|
|
51
92
|
resolve(result);
|
|
52
93
|
}];
|
|
94
|
+
#endif
|
|
53
95
|
}
|
|
54
96
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[self setRequestConfiguration:requestConfiguration];
|
|
60
|
-
resolve([NSNull null]);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
- (void)setRequestConfiguration:(NSDictionary *)requestConfiguration {
|
|
97
|
+
- (void)setRequestConfiguration:(NSDictionary *)requestConfiguration
|
|
98
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
99
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
100
|
+
#if !TARGET_OS_MACCATALYST
|
|
64
101
|
if (requestConfiguration[@"maxAdContentRating"]) {
|
|
65
102
|
NSString *rating = requestConfiguration[@"maxAdContentRating"];
|
|
66
103
|
if ([rating isEqualToString:@"G"]) {
|
|
@@ -99,11 +136,13 @@ RCT_EXPORT_METHOD(setRequestConfiguration
|
|
|
99
136
|
}
|
|
100
137
|
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = devices;
|
|
101
138
|
}
|
|
139
|
+
|
|
140
|
+
resolve([NSNull null]);
|
|
141
|
+
#endif
|
|
102
142
|
}
|
|
103
143
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
144
|
+
- (void)openAdInspector:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
145
|
+
#if !TARGET_OS_MACCATALYST
|
|
107
146
|
[GADMobileAds.sharedInstance
|
|
108
147
|
presentAdInspectorFromViewController:RCTSharedApplication().delegate.window.rootViewController
|
|
109
148
|
completionHandler:^(NSError *_Nullable error) {
|
|
@@ -119,15 +158,7 @@ RCT_EXPORT_METHOD(openAdInspector
|
|
|
119
158
|
resolve(nil);
|
|
120
159
|
}
|
|
121
160
|
}];
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
RCT_EXPORT_METHOD(openDebugMenu : (NSString *)adUnit) {
|
|
125
|
-
GADDebugOptionsViewController *debugOptionsViewController =
|
|
126
|
-
[GADDebugOptionsViewController debugOptionsViewControllerWithAdUnitID:adUnit];
|
|
127
|
-
[RCTSharedApplication().delegate.window.rootViewController
|
|
128
|
-
presentViewController:debugOptionsViewController
|
|
129
|
-
animated:YES
|
|
130
|
-
completion:nil];
|
|
161
|
+
#endif
|
|
131
162
|
}
|
|
132
163
|
|
|
133
164
|
@end
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
#if !TARGET_OS_MACCATALYST
|
|
19
|
+
|
|
18
20
|
#import <React/RCTBridgeModule.h>
|
|
19
21
|
|
|
20
22
|
@interface RCT_EXTERN_MODULE (RNGoogleMobileAdsRewardedInterstitialModule, NSObject)
|
|
@@ -40,3 +42,5 @@ RCT_EXTERN_METHOD(rewardedInterstitialShow
|
|
|
40
42
|
: (RCTPromiseRejectBlock)reject)
|
|
41
43
|
|
|
42
44
|
@end
|
|
45
|
+
|
|
46
|
+
#endif
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
#if !TARGET_OS_MACCATALYST
|
|
19
|
+
|
|
18
20
|
#import <React/RCTBridgeModule.h>
|
|
19
21
|
|
|
20
22
|
@interface RCT_EXTERN_MODULE (RNGoogleMobileAdsRewardedModule, NSObject)
|
|
@@ -40,3 +42,5 @@ RCT_EXTERN_METHOD(rewardedShow
|
|
|
40
42
|
: (RCTPromiseRejectBlock)reject)
|
|
41
43
|
|
|
42
44
|
@end
|
|
45
|
+
|
|
46
|
+
#endif
|
package/jest.setup.ts
CHANGED
|
@@ -20,12 +20,23 @@ jest.doMock('react-native', () => {
|
|
|
20
20
|
removeListeners: jest.fn(),
|
|
21
21
|
eventsAddListener: jest.fn(),
|
|
22
22
|
eventsNotifyReady: jest.fn(),
|
|
23
|
+
},
|
|
24
|
+
RNGoogleMobileAdsInterstitialModule: {
|
|
23
25
|
interstitialLoad: jest.fn(),
|
|
24
26
|
},
|
|
25
|
-
RNGoogleMobileAdsInterstitialModule: {},
|
|
26
27
|
RNGoogleMobileAdsRewardedModule: {},
|
|
27
28
|
RNGoogleMobileAdsConsentModule: {},
|
|
28
29
|
},
|
|
30
|
+
TurboModuleRegistry: {
|
|
31
|
+
getEnforcing: () => {
|
|
32
|
+
return {
|
|
33
|
+
initialize: jest.fn(),
|
|
34
|
+
setRequestConfiguration: jest.fn(),
|
|
35
|
+
openAdInspector: jest.fn(),
|
|
36
|
+
openDebugMenu: jest.fn(),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
},
|
|
29
40
|
},
|
|
30
41
|
ReactNative,
|
|
31
42
|
);
|
|
@@ -4,29 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.MobileAds = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _NativeGoogleMobileAdsModule = _interopRequireDefault(require("./NativeGoogleMobileAdsModule"));
|
|
8
8
|
var _validateAdRequestConfiguration = require("./validateAdRequestConfiguration");
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
var _SharedEventEmitter = require("./internal/SharedEventEmitter");
|
|
10
|
+
var _GoogleMobileAdsNativeEventEmitter = require("./internal/GoogleMobileAdsNativeEventEmitter");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const NATIVE_MODULE_EVENT_SUBSCRIPTIONS = {};
|
|
13
|
+
const nativeEvents = ['google_mobile_ads_app_open_event', 'google_mobile_ads_interstitial_event', 'google_mobile_ads_rewarded_event', 'google_mobile_ads_rewarded_interstitial_event'];
|
|
14
|
+
class MobileAdsModule {
|
|
15
|
+
constructor() {
|
|
16
|
+
if (nativeEvents && nativeEvents.length) {
|
|
17
|
+
for (let i = 0, len = nativeEvents.length; i < len; i++) {
|
|
18
|
+
this.subscribeToNativeModuleEvent(nativeEvents[i]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
subscribeToNativeModuleEvent(eventName) {
|
|
23
|
+
if (!NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName]) {
|
|
24
|
+
_GoogleMobileAdsNativeEventEmitter.GoogleMobileAdsNativeEventEmitter.addListener(eventName, event => {
|
|
25
|
+
_SharedEventEmitter.SharedEventEmitter.emit(`${eventName}:${event.adUnitId}:${event.requestId}`, event);
|
|
26
|
+
});
|
|
27
|
+
NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName] = true;
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
initialize() {
|
|
29
|
-
return
|
|
31
|
+
return _NativeGoogleMobileAdsModule.default.initialize();
|
|
30
32
|
}
|
|
31
33
|
setRequestConfiguration(requestConfiguration) {
|
|
32
34
|
let config;
|
|
@@ -37,24 +39,17 @@ class MobileAdsModule extends _internal.Module {
|
|
|
37
39
|
throw new Error(`googleMobileAds.setRequestConfiguration(*) ${e.message}`);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
return
|
|
42
|
+
return _NativeGoogleMobileAdsModule.default.setRequestConfiguration(config);
|
|
41
43
|
}
|
|
42
44
|
openAdInspector() {
|
|
43
|
-
return
|
|
45
|
+
return _NativeGoogleMobileAdsModule.default.openAdInspector();
|
|
44
46
|
}
|
|
45
47
|
openDebugMenu(adUnit) {
|
|
46
48
|
if (!adUnit) throw new Error('googleMobileAds.openDebugMenu expected a non-empty string value');
|
|
47
|
-
|
|
49
|
+
_NativeGoogleMobileAdsModule.default.openDebugMenu(adUnit);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
const MobileAdsInstance = new MobileAdsModule(
|
|
51
|
-
name: 'AppName'
|
|
52
|
-
}, {
|
|
53
|
-
version: _version.version,
|
|
54
|
-
namespace,
|
|
55
|
-
nativeModuleName,
|
|
56
|
-
nativeEvents: ['google_mobile_ads_app_open_event', 'google_mobile_ads_interstitial_event', 'google_mobile_ads_rewarded_event', 'google_mobile_ads_rewarded_interstitial_event']
|
|
57
|
-
});
|
|
52
|
+
const MobileAdsInstance = new MobileAdsModule();
|
|
58
53
|
const MobileAds = () => {
|
|
59
54
|
return MobileAdsInstance;
|
|
60
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NATIVE_MODULE_EVENT_SUBSCRIPTIONS","nativeEvents","MobileAdsModule","constructor","length","i","len","subscribeToNativeModuleEvent","eventName","GoogleMobileAdsNativeEventEmitter","addListener","event","SharedEventEmitter","emit","adUnitId","requestId","initialize","RNGoogleMobileAdsModule","setRequestConfiguration","requestConfiguration","config","validateAdRequestConfiguration","e","Error","message","openAdInspector","openDebugMenu","adUnit","MobileAdsInstance","MobileAds"],"sourceRoot":"../../src","sources":["MobileAds.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAAiG;AAIjG,MAAMA,iCAA0D,GAAG,CAAC,CAAC;AAErE,MAAMC,YAAY,GAAG,CACnB,kCAAkC,EAClC,sCAAsC,EACtC,kCAAkC,EAClC,+CAA+C,CAChD;AAED,MAAMC,eAAe,CAAqC;EACxDC,WAAW,GAAG;IACZ,IAAIF,YAAY,IAAIA,YAAY,CAACG,MAAM,EAAE;MACvC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,GAAG,GAAGL,YAAY,CAACG,MAAM,EAAEC,CAAC,GAAGC,GAAG,EAAED,CAAC,EAAE,EAAE;QACvD,IAAI,CAACE,4BAA4B,CAACN,YAAY,CAACI,CAAC,CAAC,CAAC;MACpD;IACF;EACF;EAEAE,4BAA4B,CAACC,SAAiB,EAAE;IAC9C,IAAI,CAACR,iCAAiC,CAACQ,SAAS,CAAC,EAAE;MACjDC,oEAAiC,CAACC,WAAW,CAACF,SAAS,EAAEG,KAAK,IAAI;QAChEC,sCAAkB,CAACC,IAAI,CAAE,GAAEL,SAAU,IAAGG,KAAK,CAACG,QAAS,IAAGH,KAAK,CAACI,SAAU,EAAC,EAAEJ,KAAK,CAAC;MACrF,CAAC,CAAC;MAEFX,iCAAiC,CAACQ,SAAS,CAAC,GAAG,IAAI;IACrD;EACF;EAEAQ,UAAU,GAAG;IACX,OAAOC,oCAAuB,CAACD,UAAU,EAAE;EAC7C;EAEAE,uBAAuB,CAACC,oBAA0C,EAAE;IAClE,IAAIC,MAAM;IACV,IAAI;MACFA,MAAM,GAAG,IAAAC,8DAA8B,EAACF,oBAAoB,CAAC;IAC/D,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYC,KAAK,EAAE;QACtB,MAAM,IAAIA,KAAK,CAAE,8CAA6CD,CAAC,CAACE,OAAQ,EAAC,CAAC;MAC5E;IACF;IAEA,OAAOP,oCAAuB,CAACC,uBAAuB,CAACE,MAAM,CAAC;EAChE;EAEAK,eAAe,GAAG;IAChB,OAAOR,oCAAuB,CAACQ,eAAe,EAAE;EAClD;EAEAC,aAAa,CAACC,MAAc,EAAE;IAC5B,IAAI,CAACA,MAAM,EAAE,MAAM,IAAIJ,KAAK,CAAC,iEAAiE,CAAC;IAC/FN,oCAAuB,CAACS,aAAa,CAACC,MAAM,CAAC;EAC/C;AACF;AAEA,MAAMC,iBAAiB,GAAG,IAAI1B,eAAe,EAAE;AAExC,MAAM2B,SAAS,GAAG,MAAM;EAC7B,OAAOD,iBAAiB;AAC1B,CAAC;AAAC;AAAA,eAEaC,SAAS;AAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _default = _reactNative.TurboModuleRegistry.getEnforcing('RNGoogleMobileAdsModule');
|
|
9
|
+
exports.default = _default;
|
|
10
|
+
//# sourceMappingURL=NativeGoogleMobileAdsModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeGoogleMobileAdsModule.ts"],"mappings":";;;;;;AACA;AAAmD,eAYpCA,gCAAmB,CAACC,YAAY,CAAO,yBAAyB,CAAC;AAAA"}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.AppOpenAd = void 0;
|
|
7
7
|
var _common = require("../common");
|
|
8
|
-
var _MobileAds = require("../MobileAds");
|
|
9
8
|
var _validateAdRequestOptions = require("../validateAdRequestOptions");
|
|
10
9
|
var _MobileAd = require("./MobileAd");
|
|
11
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -23,7 +22,7 @@ class AppOpenAd extends _MobileAd.MobileAd {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
const requestId = AppOpenAd._appOpenRequest++;
|
|
26
|
-
return new AppOpenAd('app_open',
|
|
25
|
+
return new AppOpenAd('app_open', 'RNGoogleMobileAdsAppOpenModule', requestId, adUnitId, options);
|
|
27
26
|
}
|
|
28
27
|
addAdEventsListener(listener) {
|
|
29
28
|
return this._addAdEventsListener(listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppOpenAd","MobileAd","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","e","message","requestId","_appOpenRequest","
|
|
1
|
+
{"version":3,"names":["AppOpenAd","MobileAd","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","e","message","requestId","_appOpenRequest","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"sourceRoot":"../../src","sources":["AppOpenAd.ts"],"mappings":";;;;;;AAiBA;AACA;AACA;AAAsC;AAM/B,MAAMA,SAAS,SAASC,kBAAQ,CAAC;EAGtC,OAAOC,kBAAkB,CAACC,QAAgB,EAAEC,cAA+B,EAAE;IAC3E,IAAI,CAAC,IAAAC,gBAAQ,EAACF,QAAQ,CAAC,EAAE;MACvB,MAAM,IAAIG,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEA,IAAIC,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI;MACFA,OAAO,GAAG,IAAAC,kDAAwB,EAACJ,cAAc,CAAC;IACpD,CAAC,CAAC,OAAOK,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYH,KAAK,EAAE;QACtB,MAAM,IAAIA,KAAK,CAAE,sCAAqCG,CAAC,CAACC,OAAQ,GAAE,CAAC;MACrE;IACF;IAEA,MAAMC,SAAS,GAAGX,SAAS,CAACY,eAAe,EAAE;IAC7C,OAAO,IAAIZ,SAAS,CAClB,UAAU,EACV,gCAAgC,EAChCW,SAAS,EACTR,QAAQ,EACRI,OAAO,CACR;EACH;EAEAM,mBAAmB,CAAwBC,QAA6B,EAAc;IACpF,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkB,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAAC;AAAA,gBAlCYd,SAAS,qBACe,CAAC"}
|
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.BaseAd = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
8
|
var _common = require("../common");
|
|
10
9
|
var _NativeError = require("../internal/NativeError");
|
|
10
|
+
var _GoogleMobileAdsBannerViewNativeComponent = _interopRequireDefault(require("./GoogleMobileAdsBannerViewNativeComponent"));
|
|
11
11
|
var _BannerAdSize = require("../BannerAdSize");
|
|
12
12
|
var _validateAdRequestOptions = require("../validateAdRequestOptions");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
16
|
/* eslint-disable react/prop-types */
|
|
@@ -62,10 +63,8 @@ const BaseAd = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}, [parsedRequestOptions]);
|
|
65
|
-
function onNativeEvent(
|
|
66
|
-
|
|
67
|
-
nativeEvent
|
|
68
|
-
} = _ref2;
|
|
66
|
+
function onNativeEvent(event) {
|
|
67
|
+
const nativeEvent = event.nativeEvent;
|
|
69
68
|
const {
|
|
70
69
|
type
|
|
71
70
|
} = nativeEvent;
|
|
@@ -95,11 +94,11 @@ const BaseAd = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
if (type === 'onAdLoaded' || type === 'onSizeChange') {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
const width = Math.ceil(nativeEvent.width);
|
|
98
|
+
const height = Math.ceil(nativeEvent.height);
|
|
99
|
+
if (width && height && JSON.stringify([width, height]) !== JSON.stringify(dimensions)) {
|
|
100
|
+
setDimensions([width, height]);
|
|
101
|
+
}
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
const style = sizes.includes(_BannerAdSize.GAMBannerAdSize.FLUID) ? {
|
|
@@ -109,17 +108,16 @@ const BaseAd = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
109
108
|
width: dimensions[0],
|
|
110
109
|
height: dimensions[1]
|
|
111
110
|
};
|
|
112
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(_GoogleMobileAdsBannerViewNativeComponent.default, {
|
|
113
112
|
ref: ref,
|
|
114
113
|
sizes: sizes,
|
|
115
114
|
style: style,
|
|
116
115
|
unitId: unitId,
|
|
117
|
-
request:
|
|
116
|
+
request: parsedRequestOptions,
|
|
118
117
|
manualImpressionsEnabled: !!manualImpressionsEnabled,
|
|
119
118
|
onNativeEvent: onNativeEvent
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
exports.BaseAd = BaseAd;
|
|
123
122
|
BaseAd.displayName = 'BaseAd';
|
|
124
|
-
const GoogleMobileAdsBannerView = (0, _reactNative.requireNativeComponent)('RNGoogleMobileAdsBannerView');
|
|
125
123
|
//# sourceMappingURL=BaseAd.js.map
|