react-native-google-mobile-ads 14.4.3 → 14.5.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.
Files changed (140) hide show
  1. package/README.md +1 -1
  2. package/__tests__/googleMobileAds.test.ts +1 -1
  3. package/__tests__/interstitial.test.ts +9 -23
  4. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.h +36 -0
  5. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.mm +100 -0
  6. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.h +4 -0
  7. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +6 -1
  8. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +2 -0
  9. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.h +53 -0
  10. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.mm +220 -0
  11. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +36 -0
  12. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.mm +80 -0
  13. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.h +36 -0
  14. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.mm +102 -0
  15. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.h +37 -0
  16. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.mm +102 -0
  17. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.h +36 -0
  18. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.mm +100 -0
  19. package/jest.setup.ts +8 -5
  20. package/lib/commonjs/MobileAds.js +1 -1
  21. package/lib/commonjs/ads/AppOpenAd.js +3 -1
  22. package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
  23. package/lib/commonjs/ads/BannerAd.js +1 -1
  24. package/lib/commonjs/ads/BannerAd.js.map +1 -1
  25. package/lib/commonjs/ads/BaseAd.js +1 -1
  26. package/lib/commonjs/ads/GAMBannerAd.js +1 -1
  27. package/lib/commonjs/ads/GAMBannerAd.js.map +1 -1
  28. package/lib/commonjs/ads/InterstitialAd.js +3 -1
  29. package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
  30. package/lib/commonjs/ads/MobileAd.js +5 -18
  31. package/lib/commonjs/ads/MobileAd.js.map +1 -1
  32. package/lib/commonjs/ads/RewardedAd.js +3 -1
  33. package/lib/commonjs/ads/RewardedAd.js.map +1 -1
  34. package/lib/commonjs/ads/RewardedInterstitialAd.js +3 -1
  35. package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -1
  36. package/lib/commonjs/specs/components/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
  37. package/lib/commonjs/specs/modules/NativeAppOpenModule.js +25 -0
  38. package/lib/commonjs/specs/modules/NativeAppOpenModule.js.map +1 -0
  39. package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js +25 -0
  40. package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
  41. package/lib/commonjs/specs/modules/NativeInterstitialModule.js +25 -0
  42. package/lib/commonjs/specs/modules/NativeInterstitialModule.js.map +1 -0
  43. package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js +25 -0
  44. package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
  45. package/lib/commonjs/specs/modules/NativeRewardedModule.js +25 -0
  46. package/lib/commonjs/specs/modules/NativeRewardedModule.js.map +1 -0
  47. package/lib/commonjs/version.js +1 -1
  48. package/lib/module/MobileAds.js +1 -1
  49. package/lib/module/MobileAds.js.map +1 -1
  50. package/lib/module/ads/AppOpenAd.js +2 -1
  51. package/lib/module/ads/AppOpenAd.js.map +1 -1
  52. package/lib/module/ads/BannerAd.js +1 -1
  53. package/lib/module/ads/BannerAd.js.map +1 -1
  54. package/lib/module/ads/BaseAd.js +1 -1
  55. package/lib/module/ads/BaseAd.js.map +1 -1
  56. package/lib/module/ads/GAMBannerAd.js +1 -1
  57. package/lib/module/ads/GAMBannerAd.js.map +1 -1
  58. package/lib/module/ads/InterstitialAd.js +3 -1
  59. package/lib/module/ads/InterstitialAd.js.map +1 -1
  60. package/lib/module/ads/MobileAd.js +5 -18
  61. package/lib/module/ads/MobileAd.js.map +1 -1
  62. package/lib/module/ads/RewardedAd.js +3 -1
  63. package/lib/module/ads/RewardedAd.js.map +1 -1
  64. package/lib/module/ads/RewardedInterstitialAd.js +3 -1
  65. package/lib/module/ads/RewardedInterstitialAd.js.map +1 -1
  66. package/lib/module/specs/components/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
  67. package/lib/module/specs/modules/NativeAppOpenModule.js +20 -0
  68. package/lib/module/specs/modules/NativeAppOpenModule.js.map +1 -0
  69. package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js +20 -0
  70. package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
  71. package/lib/module/specs/modules/NativeInterstitialModule.js +20 -0
  72. package/lib/module/specs/modules/NativeInterstitialModule.js.map +1 -0
  73. package/lib/module/specs/modules/NativeRewardedInterstitialModule.js +20 -0
  74. package/lib/module/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
  75. package/lib/module/specs/modules/NativeRewardedModule.js +20 -0
  76. package/lib/module/specs/modules/NativeRewardedModule.js.map +1 -0
  77. package/lib/module/version.js +1 -1
  78. package/lib/typescript/ads/AppOpenAd.d.ts.map +1 -1
  79. package/lib/typescript/ads/BannerAd.d.ts.map +1 -1
  80. package/lib/typescript/ads/BaseAd.d.ts +1 -1
  81. package/lib/typescript/ads/BaseAd.d.ts.map +1 -1
  82. package/lib/typescript/ads/GAMBannerAd.d.ts.map +1 -1
  83. package/lib/typescript/ads/InterstitialAd.d.ts.map +1 -1
  84. package/lib/typescript/ads/MobileAd.d.ts +5 -4
  85. package/lib/typescript/ads/MobileAd.d.ts.map +1 -1
  86. package/lib/typescript/ads/RewardedAd.d.ts.map +1 -1
  87. package/lib/typescript/ads/RewardedInterstitialAd.d.ts.map +1 -1
  88. package/lib/typescript/index.d.ts +1 -1
  89. package/lib/typescript/specs/components/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +1 -0
  90. package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts +25 -0
  91. package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts.map +1 -0
  92. package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts +30 -0
  93. package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts.map +1 -0
  94. package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts +25 -0
  95. package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts.map +1 -0
  96. package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts +25 -0
  97. package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts.map +1 -0
  98. package/lib/typescript/specs/modules/NativeRewardedModule.d.ts +25 -0
  99. package/lib/typescript/specs/modules/NativeRewardedModule.d.ts.map +1 -0
  100. package/lib/typescript/version.d.ts +1 -1
  101. package/package.json +2 -2
  102. package/src/MobileAds.ts +1 -1
  103. package/src/ads/AppOpenAd.ts +3 -1
  104. package/src/ads/BannerAd.tsx +3 -1
  105. package/src/ads/BaseAd.tsx +2 -2
  106. package/src/ads/GAMBannerAd.tsx +3 -1
  107. package/src/ads/InterstitialAd.ts +3 -1
  108. package/src/ads/MobileAd.ts +9 -25
  109. package/src/ads/RewardedAd.ts +3 -1
  110. package/src/ads/RewardedInterstitialAd.ts +3 -1
  111. package/src/specs/modules/NativeAppOpenModule.ts +26 -0
  112. package/src/specs/modules/NativeGoogleMobileAdsModule.ts +33 -0
  113. package/src/specs/modules/NativeInterstitialModule.ts +26 -0
  114. package/src/specs/modules/NativeRewardedInterstitialModule.ts +32 -0
  115. package/src/specs/modules/NativeRewardedModule.ts +26 -0
  116. package/src/version.ts +1 -1
  117. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +0 -46
  118. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.swift +0 -85
  119. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.swift +0 -231
  120. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.swift +0 -76
  121. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +0 -46
  122. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.swift +0 -123
  123. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.m +0 -46
  124. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.swift +0 -85
  125. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +0 -46
  126. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.swift +0 -85
  127. package/lib/commonjs/NativeGoogleMobileAdsModule.js +0 -9
  128. package/lib/commonjs/NativeGoogleMobileAdsModule.js.map +0 -1
  129. package/lib/commonjs/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +0 -1
  130. package/lib/module/NativeGoogleMobileAdsModule.js +0 -3
  131. package/lib/module/NativeGoogleMobileAdsModule.js.map +0 -1
  132. package/lib/module/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +0 -1
  133. package/lib/typescript/NativeGoogleMobileAdsModule.d.ts +0 -14
  134. package/lib/typescript/NativeGoogleMobileAdsModule.d.ts.map +0 -1
  135. package/lib/typescript/ads/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +0 -1
  136. package/src/NativeGoogleMobileAdsModule.ts +0 -16
  137. /package/lib/commonjs/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.js +0 -0
  138. /package/lib/module/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.js +0 -0
  139. /package/lib/typescript/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.d.ts +0 -0
  140. /package/src/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.ts +0 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import <Foundation/Foundation.h>
21
+
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+
24
+ #import <RNGoogleMobileAdsSpec/RNGoogleMobileAdsSpec.h>
25
+ @interface RNGoogleMobileAdsInterstitialModule : NSObject <NativeInterstitialModuleSpec>
26
+
27
+ #else
28
+
29
+ #import <React/RCTBridgeModule.h>
30
+ @interface RNGoogleMobileAdsInterstitialModule : NSObject <RCTBridgeModule>
31
+
32
+ #endif
33
+
34
+ @end
35
+
36
+ #endif
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import "RNGoogleMobileAdsInterstitialModule.h"
21
+ #import <GoogleMobileAds/GoogleMobileAds.h>
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+ #import "RNGoogleMobileAdsSpec.h"
24
+ #endif
25
+ #import "RNGoogleMobileAdsCommon.h"
26
+ #import "RNGoogleMobileAdsFullScreenAd.h"
27
+
28
+ @interface RNGoogleMobileAdsInterstitialAd : RNGoogleMobileAdsFullScreenAd
29
+
30
+ @end
31
+
32
+ @implementation RNGoogleMobileAdsInterstitialAd
33
+
34
+ - (NSString *)getAdEventName {
35
+ return GOOGLE_MOBILE_ADS_EVENT_INTERSTITIAL;
36
+ }
37
+
38
+ - (void)loadAd:(NSString *)adUnitId
39
+ adRequest:(GAMRequest *)adRequest
40
+ completionHandler:
41
+ (void (^)(GAMInterstitialAd *_Nullable ad, NSError *_Nullable error))completionHandler {
42
+ [GAMInterstitialAd loadWithAdManagerAdUnitID:adUnitId
43
+ request:adRequest
44
+ completionHandler:completionHandler];
45
+ }
46
+
47
+ @end
48
+
49
+ @implementation RNGoogleMobileAdsInterstitialModule {
50
+ RNGoogleMobileAdsInterstitialAd *_ad;
51
+ }
52
+
53
+ RCT_EXPORT_MODULE();
54
+
55
+ - (dispatch_queue_t)methodQueue {
56
+ return dispatch_get_main_queue();
57
+ }
58
+
59
+ RCT_EXPORT_METHOD(interstitialLoad
60
+ : (double)requestId adUnitId
61
+ : (NSString *)adUnitId requestOptions
62
+ : (NSDictionary *)requestOptions) {
63
+ [_ad loadWithRequestId:requestId adUnitId:adUnitId adRequestOptions:requestOptions];
64
+ }
65
+
66
+ RCT_EXPORT_METHOD(interstitialShow
67
+ : (double)requestId adUnitId
68
+ : (NSString *)adUnitId showOptions
69
+ : (NSDictionary *)showOptions resolve
70
+ : (RCTPromiseResolveBlock)resolve reject
71
+ : (RCTPromiseRejectBlock)reject) {
72
+ [_ad showWithRequestId:requestId
73
+ adUnitId:adUnitId
74
+ showOptions:showOptions
75
+ resolve:resolve
76
+ reject:reject];
77
+ }
78
+
79
+ RCT_EXPORT_METHOD(invalidate) { [_ad invalidate]; }
80
+
81
+ #ifdef RCT_NEW_ARCH_ENABLED
82
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
83
+ (const facebook::react::ObjCTurboModule::InitParams &)params {
84
+ return std::make_shared<facebook::react::NativeInterstitialModuleSpecJSI>(params);
85
+ }
86
+ #endif
87
+
88
+ - (instancetype)init {
89
+ self = [super init];
90
+ if (self) {
91
+ _ad = [[RNGoogleMobileAdsInterstitialAd alloc] init];
92
+ }
93
+ return self;
94
+ }
95
+
96
+ - (void)dealloc {
97
+ [self invalidate];
98
+ }
99
+
100
+ @end
101
+
102
+ #endif
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import <Foundation/Foundation.h>
21
+
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+
24
+ #import <RNGoogleMobileAdsSpec/RNGoogleMobileAdsSpec.h>
25
+ @interface RNGoogleMobileAdsRewardedInterstitialModule
26
+ : NSObject <NativeRewardedInterstitialModuleSpec>
27
+
28
+ #else
29
+
30
+ #import <React/RCTBridgeModule.h>
31
+ @interface RNGoogleMobileAdsRewardedInterstitialModule : NSObject <RCTBridgeModule>
32
+
33
+ #endif
34
+
35
+ @end
36
+
37
+ #endif
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import "RNGoogleMobileAdsRewardedInterstitialModule.h"
21
+ #import <GoogleMobileAds/GoogleMobileAds.h>
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+ #import "RNGoogleMobileAdsSpec.h"
24
+ #endif
25
+ #import "RNGoogleMobileAdsCommon.h"
26
+ #import "RNGoogleMobileAdsFullScreenAd.h"
27
+
28
+ @interface RNGoogleMobileAdsRewardedInterstitialAd : RNGoogleMobileAdsFullScreenAd
29
+
30
+ @end
31
+
32
+ @implementation RNGoogleMobileAdsRewardedInterstitialAd
33
+
34
+ - (NSString *)getAdEventName {
35
+ return GOOGLE_MOBILE_ADS_EVENT_REWARDED_INTERSTITIAL;
36
+ }
37
+
38
+ - (void)loadAd:(NSString *)adUnitId
39
+ adRequest:(GAMRequest *)adRequest
40
+ completionHandler:(void (^)(GADRewardedInterstitialAd *_Nullable ad,
41
+ NSError *_Nullable error))completionHandler {
42
+ [GADRewardedInterstitialAd loadWithAdUnitID:adUnitId
43
+ request:adRequest
44
+ completionHandler:completionHandler];
45
+ }
46
+
47
+ @end
48
+
49
+ @implementation RNGoogleMobileAdsRewardedInterstitialModule {
50
+ RNGoogleMobileAdsRewardedInterstitialAd *_ad;
51
+ }
52
+
53
+ RCT_EXPORT_MODULE();
54
+
55
+ - (dispatch_queue_t)methodQueue {
56
+ return dispatch_get_main_queue();
57
+ }
58
+
59
+ RCT_EXPORT_METHOD(rewardedInterstitialLoad
60
+ : (double)requestId adUnitId
61
+ : (NSString *)adUnitId requestOptions
62
+ : (NSDictionary *)requestOptions) {
63
+ [_ad loadWithRequestId:requestId adUnitId:adUnitId adRequestOptions:requestOptions];
64
+ }
65
+
66
+ RCT_EXPORT_METHOD(rewardedInterstitialShow
67
+ : (double)requestId adUnitId
68
+ : (NSString *)adUnitId showOptions
69
+ : (NSDictionary *)showOptions resolve
70
+ : (RCTPromiseResolveBlock)resolve reject
71
+ : (RCTPromiseRejectBlock)reject) {
72
+ [_ad showWithRequestId:requestId
73
+ adUnitId:adUnitId
74
+ showOptions:showOptions
75
+ resolve:resolve
76
+ reject:reject];
77
+ }
78
+
79
+ RCT_EXPORT_METHOD(invalidate) { [_ad invalidate]; }
80
+
81
+ #ifdef RCT_NEW_ARCH_ENABLED
82
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
83
+ (const facebook::react::ObjCTurboModule::InitParams &)params {
84
+ return std::make_shared<facebook::react::NativeRewardedInterstitialModuleSpecJSI>(params);
85
+ }
86
+ #endif
87
+
88
+ - (instancetype)init {
89
+ self = [super init];
90
+ if (self) {
91
+ _ad = [[RNGoogleMobileAdsRewardedInterstitialAd alloc] init];
92
+ }
93
+ return self;
94
+ }
95
+
96
+ - (void)dealloc {
97
+ [self invalidate];
98
+ }
99
+
100
+ @end
101
+
102
+ #endif
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import <Foundation/Foundation.h>
21
+
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+
24
+ #import <RNGoogleMobileAdsSpec/RNGoogleMobileAdsSpec.h>
25
+ @interface RNGoogleMobileAdsRewardedModule : NSObject <NativeRewardedModuleSpec>
26
+
27
+ #else
28
+
29
+ #import <React/RCTBridgeModule.h>
30
+ @interface RNGoogleMobileAdsRewardedModule : NSObject <RCTBridgeModule>
31
+
32
+ #endif
33
+
34
+ @end
35
+
36
+ #endif
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #if !TARGET_OS_MACCATALYST
19
+
20
+ #import "RNGoogleMobileAdsRewardedModule.h"
21
+ #import <GoogleMobileAds/GoogleMobileAds.h>
22
+ #ifdef RCT_NEW_ARCH_ENABLED
23
+ #import "RNGoogleMobileAdsSpec.h"
24
+ #endif
25
+ #import "RNGoogleMobileAdsCommon.h"
26
+ #import "RNGoogleMobileAdsFullScreenAd.h"
27
+
28
+ @interface RNGoogleMobileAdsRewardedAd : RNGoogleMobileAdsFullScreenAd
29
+
30
+ @end
31
+
32
+ @implementation RNGoogleMobileAdsRewardedAd
33
+
34
+ - (NSString *)getAdEventName {
35
+ return GOOGLE_MOBILE_ADS_EVENT_REWARDED;
36
+ }
37
+
38
+ - (void)loadAd:(NSString *)adUnitId
39
+ adRequest:(GAMRequest *)adRequest
40
+ completionHandler:
41
+ (void (^)(GADRewardedAd *_Nullable ad, NSError *_Nullable error))completionHandler {
42
+ [GADRewardedAd loadWithAdUnitID:adUnitId request:adRequest completionHandler:completionHandler];
43
+ }
44
+
45
+ @end
46
+
47
+ @implementation RNGoogleMobileAdsRewardedModule {
48
+ RNGoogleMobileAdsRewardedAd *_ad;
49
+ }
50
+
51
+ RCT_EXPORT_MODULE();
52
+
53
+ - (dispatch_queue_t)methodQueue {
54
+ return dispatch_get_main_queue();
55
+ }
56
+
57
+ RCT_EXPORT_METHOD(rewardedLoad
58
+ : (double)requestId adUnitId
59
+ : (NSString *)adUnitId requestOptions
60
+ : (NSDictionary *)requestOptions) {
61
+ [_ad loadWithRequestId:requestId adUnitId:adUnitId adRequestOptions:requestOptions];
62
+ }
63
+
64
+ RCT_EXPORT_METHOD(rewardedShow
65
+ : (double)requestId adUnitId
66
+ : (NSString *)adUnitId showOptions
67
+ : (NSDictionary *)showOptions resolve
68
+ : (RCTPromiseResolveBlock)resolve reject
69
+ : (RCTPromiseRejectBlock)reject) {
70
+ [_ad showWithRequestId:requestId
71
+ adUnitId:adUnitId
72
+ showOptions:showOptions
73
+ resolve:resolve
74
+ reject:reject];
75
+ }
76
+
77
+ RCT_EXPORT_METHOD(invalidate) { [_ad invalidate]; }
78
+
79
+ #ifdef RCT_NEW_ARCH_ENABLED
80
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
81
+ (const facebook::react::ObjCTurboModule::InitParams &)params {
82
+ return std::make_shared<facebook::react::NativeRewardedModuleSpecJSI>(params);
83
+ }
84
+ #endif
85
+
86
+ - (instancetype)init {
87
+ self = [super init];
88
+ if (self) {
89
+ _ad = [[RNGoogleMobileAdsRewardedAd alloc] init];
90
+ }
91
+ return self;
92
+ }
93
+
94
+ - (void)dealloc {
95
+ [self invalidate];
96
+ }
97
+
98
+ @end
99
+
100
+ #endif
package/jest.setup.ts CHANGED
@@ -17,15 +17,18 @@ jest.doMock('react-native', () => {
17
17
  eventsAddListener: jest.fn(),
18
18
  eventsNotifyReady: jest.fn(),
19
19
  },
20
- RNGoogleMobileAdsInterstitialModule: {
21
- interstitialLoad: jest.fn(),
22
- },
23
20
  RNGoogleMobileAdsRewardedModule: {},
24
21
  RNGoogleMobileAdsConsentModule: {},
25
22
  },
26
23
  TurboModuleRegistry: {
27
24
  ...ReactNative.TurboModuleRegistry,
28
- getEnforcing: () => {
25
+ getEnforcing: moduleName => {
26
+ if (moduleName === 'RNGoogleMobileAdsInterstitialModule') {
27
+ return {
28
+ interstitialLoad: jest.fn(),
29
+ };
30
+ }
31
+
29
32
  return {
30
33
  initialize: jest.fn(),
31
34
  setRequestConfiguration: jest.fn(),
@@ -40,7 +43,7 @@ jest.doMock('react-native', () => {
40
43
  ReactNative,
41
44
  );
42
45
  });
43
- jest.doMock('./src/ads/GoogleMobileAdsBannerViewNativeComponent', () => {
46
+ jest.doMock('./src/specs/components/GoogleMobileAdsBannerViewNativeComponent', () => {
44
47
  return {
45
48
  __esModule: true,
46
49
  Commands: {},
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.MobileAds = void 0;
7
- var _NativeGoogleMobileAdsModule = _interopRequireDefault(require("./NativeGoogleMobileAdsModule"));
7
+ var _NativeGoogleMobileAdsModule = _interopRequireDefault(require("./specs/modules/NativeGoogleMobileAdsModule"));
8
8
  var _validateAdRequestConfiguration = require("./validateAdRequestConfiguration");
9
9
  var _SharedEventEmitter = require("./internal/SharedEventEmitter");
10
10
  var _GoogleMobileAdsNativeEventEmitter = require("./internal/GoogleMobileAdsNativeEventEmitter");
@@ -7,6 +7,8 @@ exports.AppOpenAd = void 0;
7
7
  var _common = require("../common");
8
8
  var _validateAdRequestOptions = require("../validateAdRequestOptions");
9
9
  var _MobileAd = require("./MobileAd");
10
+ var _NativeAppOpenModule = _interopRequireDefault(require("../specs/modules/NativeAppOpenModule"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
12
  /*
11
13
  * Copyright (c) 2016-present Invertase Limited & Contributors
12
14
  *
@@ -39,7 +41,7 @@ class AppOpenAd extends _MobileAd.MobileAd {
39
41
  }
40
42
  }
41
43
  const requestId = AppOpenAd._appOpenRequest++;
42
- return new AppOpenAd('app_open', 'RNGoogleMobileAdsAppOpenModule', requestId, adUnitId, options);
44
+ return new AppOpenAd('app_open', requestId, adUnitId, _NativeAppOpenModule.default.appOpenLoad, _NativeAppOpenModule.default.appOpenShow, options);
43
45
  }
44
46
  addAdEventsListener(listener) {
45
47
  return this._addAdEventsListener(listener);
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_validateAdRequestOptions","_MobileAd","AppOpenAd","MobileAd","_appOpenRequest","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","e","message","requestId","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener","exports"],"sourceRoot":"../../../src","sources":["ads/AppOpenAd.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAMG,SAAS,SAASC,kBAAQ,CAAC;EACtC,OAAiBC,eAAe,GAAG,CAAC;EAEpC,OAAOC,kBAAkBA,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,CAAC,sCAAsCG,CAAC,CAACC,OAAO,GAAG,CAAC;MACrE;IACF;IAEA,MAAMC,SAAS,GAAGZ,SAAS,CAACE,eAAe,EAAE;IAC7C,OAAO,IAAIF,SAAS,CAClB,UAAU,EACV,gCAAgC,EAChCY,SAAS,EACTR,QAAQ,EACRI,OACF,CAAC;EACH;EAEAK,mBAAmBA,CAAwBC,QAA6B,EAAc;IACpF,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkBA,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAACK,OAAA,CAAAnB,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","_validateAdRequestOptions","_MobileAd","_NativeAppOpenModule","_interopRequireDefault","e","__esModule","default","AppOpenAd","MobileAd","_appOpenRequest","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","message","requestId","NativeAppOpenModule","appOpenLoad","appOpenShow","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener","exports"],"sourceRoot":"../../../src","sources":["ads/AppOpenAd.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAuE,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAxBvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,MAAMG,SAAS,SAASC,kBAAQ,CAAC;EACtC,OAAiBC,eAAe,GAAG,CAAC;EAEpC,OAAOC,kBAAkBA,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,OAAOR,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYU,KAAK,EAAE;QACtB,MAAM,IAAIA,KAAK,CAAC,sCAAsCV,CAAC,CAACa,OAAO,GAAG,CAAC;MACrE;IACF;IAEA,MAAMC,SAAS,GAAGX,SAAS,CAACE,eAAe,EAAE;IAC7C,OAAO,IAAIF,SAAS,CAClB,UAAU,EACVW,SAAS,EACTP,QAAQ,EACRQ,4BAAmB,CAACC,WAAW,EAC/BD,4BAAmB,CAACE,WAAW,EAC/BN,OACF,CAAC;EACH;EAEAO,mBAAmBA,CAAwBC,QAA6B,EAAc;IACpF,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkBA,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAACK,OAAA,CAAArB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.BannerAd = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _BaseAd = require("./BaseAd");
9
- var _GoogleMobileAdsBannerViewNativeComponent = require("./GoogleMobileAdsBannerViewNativeComponent");
9
+ var _GoogleMobileAdsBannerViewNativeComponent = require("../specs/components/GoogleMobileAdsBannerViewNativeComponent");
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /*
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_BaseAd","_GoogleMobileAdsBannerViewNativeComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","BannerAd","React","Component","ref","createRef","load","current","Commands","render","createElement","BaseAd","sizes","props","size","exports"],"sourceRoot":"../../../src","sources":["ads/BannerAd.tsx"],"mappings":";;;;;;AAiBA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,yCAAA,GAAAF,OAAA;AAAiG,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAA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AMG,QAAQ,SAASC,cAAK,CAACC,SAAS,CAAgB;EACnDC,GAAG,gBAAG,IAAAC,gBAAS,EAAqD,CAAC;EAE7EC,IAAIA,CAAA,EAAG;IACL,IAAI,IAAI,CAACF,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACF,IAAI,CAAC,IAAI,CAACF,GAAG,CAACG,OAAO,CAAC;IACjC;EACF;EAEAE,MAAMA,CAAA,EAAG;IACP,oBAAOvC,MAAA,CAAAW,OAAA,CAAA6B,aAAA,CAACrC,OAAA,CAAAsC,MAAM,EAAAhB,QAAA;MAACS,GAAG,EAAE,IAAI,CAACA,GAAI;MAACQ,KAAK,EAAE,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI;IAAE,GAAK,IAAI,CAACD,KAAK,CAAG,CAAC;EAC5E;AACF;AAACE,OAAA,CAAAd,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_BaseAd","_GoogleMobileAdsBannerViewNativeComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","BannerAd","React","Component","ref","createRef","load","current","Commands","render","createElement","BaseAd","sizes","props","size","exports"],"sourceRoot":"../../../src","sources":["ads/BannerAd.tsx"],"mappings":";;;;;;AAiBA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,yCAAA,GAAAF,OAAA;AAEsE,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA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KAtBtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMG,QAAQ,SAASC,cAAK,CAACC,SAAS,CAAgB;EACnDC,GAAG,gBAAG,IAAAC,gBAAS,EAAqD,CAAC;EAE7EC,IAAIA,CAAA,EAAG;IACL,IAAI,IAAI,CAACF,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACF,IAAI,CAAC,IAAI,CAACF,GAAG,CAACG,OAAO,CAAC;IACjC;EACF;EAEAE,MAAMA,CAAA,EAAG;IACP,oBAAOvC,MAAA,CAAAW,OAAA,CAAA6B,aAAA,CAACrC,OAAA,CAAAsC,MAAM,EAAAhB,QAAA;MAACS,GAAG,EAAE,IAAI,CAACA,GAAI;MAACQ,KAAK,EAAE,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI;IAAE,GAAK,IAAI,CAACD,KAAK,CAAG,CAAC;EAC5E;AACF;AAACE,OAAA,CAAAd,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _common = require("../common");
10
10
  var _NativeError = require("../internal/NativeError");
11
- var _GoogleMobileAdsBannerViewNativeComponent = _interopRequireDefault(require("./GoogleMobileAdsBannerViewNativeComponent"));
11
+ var _GoogleMobileAdsBannerViewNativeComponent = _interopRequireDefault(require("../specs/components/GoogleMobileAdsBannerViewNativeComponent"));
12
12
  var _BannerAdSize = require("../BannerAdSize");
13
13
  var _validateAdRequestOptions = require("../validateAdRequestOptions");
14
14
  var _debounce = require("../common/debounce");
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.GAMBannerAd = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _BaseAd = require("./BaseAd");
9
- var _GoogleMobileAdsBannerViewNativeComponent = require("./GoogleMobileAdsBannerViewNativeComponent");
9
+ var _GoogleMobileAdsBannerViewNativeComponent = require("../specs/components/GoogleMobileAdsBannerViewNativeComponent");
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /*
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_BaseAd","_GoogleMobileAdsBannerViewNativeComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","GAMBannerAd","React","Component","ref","createRef","recordManualImpression","current","Commands","load","render","createElement","BaseAd","props","exports"],"sourceRoot":"../../../src","sources":["ads/GAMBannerAd.tsx"],"mappings":";;;;;;AAiBA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,yCAAA,GAAAF,OAAA;AAAiG,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CA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AA,MAAAM,CAAA,CAAAN,CAAA,IAAAC,CAAA,CAAAD,CAAA,aAAAM,CAAA,KAAAW,QAAA,CAAAK,KAAA,OAAAF,SAAA,KApBjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,MAAMG,WAAW,SAASC,cAAK,CAACC,SAAS,CAAmB;EACzDC,GAAG,gBAAG,IAAAC,gBAAS,EAAqD,CAAC;EAE7EC,sBAAsBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACF,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACF,sBAAsB,CAAC,IAAI,CAACF,GAAG,CAACG,OAAO,CAAC;IACnD;EACF;EAEAE,IAAIA,CAAA,EAAG;IACL,IAAI,IAAI,CAACL,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACC,IAAI,CAAC,IAAI,CAACL,GAAG,CAACG,OAAO,CAAC;IACjC;EACF;EAEAG,MAAMA,CAAA,EAAG;IACP,oBAAOxC,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACtC,OAAA,CAAAuC,MAAM,EAAAjB,QAAA;MAACS,GAAG,EAAE,IAAI,CAACA;IAAI,GAAK,IAAI,CAACS,KAAK,CAAG,CAAC;EAClD;AACF;AAACC,OAAA,CAAAb,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_BaseAd","_GoogleMobileAdsBannerViewNativeComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","GAMBannerAd","React","Component","ref","createRef","recordManualImpression","current","Commands","load","render","createElement","BaseAd","props","exports"],"sourceRoot":"../../../src","sources":["ads/GAMBannerAd.tsx"],"mappings":";;;;;;AAiBA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,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,CAAA,aAAAR,CAAA,MAAAA,CAAA,GAAAsB,SAAA,CAAAC,MAAA,EAAAvB,CAAA,UAAAG,CAAA,GAAAmB,SAAA,CAAAtB,CAAA,YAAAE,CAAA,IAAAC,CAAA,OAAAY,cAAA,CAAAC,IAAA,CAAAb,CAAA,EAAAD,CAAA,MAAAM,CAAA,CAAAN,CAAA,IAAAC,CAAA,CAAAD,CAAA,aAAAM,CAAA,KAAAW,QAAA,CAAAK,KAAA,OAAAF,SAAA,KAtBtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMG,WAAW,SAASC,cAAK,CAACC,SAAS,CAAmB;EACzDC,GAAG,gBAAG,IAAAC,gBAAS,EAAqD,CAAC;EAE7EC,sBAAsBA,CAAA,EAAG;IACvB,IAAI,IAAI,CAACF,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACF,sBAAsB,CAAC,IAAI,CAACF,GAAG,CAACG,OAAO,CAAC;IACnD;EACF;EAEAE,IAAIA,CAAA,EAAG;IACL,IAAI,IAAI,CAACL,GAAG,CAACG,OAAO,EAAE;MACpBC,kDAAQ,CAACC,IAAI,CAAC,IAAI,CAACL,GAAG,CAACG,OAAO,CAAC;IACjC;EACF;EAEAG,MAAMA,CAAA,EAAG;IACP,oBAAOxC,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACtC,OAAA,CAAAuC,MAAM,EAAAjB,QAAA;MAACS,GAAG,EAAE,IAAI,CAACA;IAAI,GAAK,IAAI,CAACS,KAAK,CAAG,CAAC;EAClD;AACF;AAACC,OAAA,CAAAb,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -7,6 +7,8 @@ exports.InterstitialAd = void 0;
7
7
  var _common = require("../common");
8
8
  var _validateAdRequestOptions = require("../validateAdRequestOptions");
9
9
  var _MobileAd = require("./MobileAd");
10
+ var _NativeInterstitialModule = _interopRequireDefault(require("../specs/modules/NativeInterstitialModule"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
12
  /*
11
13
  * Copyright (c) 2016-present Invertase Limited & Contributors
12
14
  *
@@ -100,7 +102,7 @@ class InterstitialAd extends _MobileAd.MobileAd {
100
102
  }
101
103
  }
102
104
  const requestId = InterstitialAd._interstitialRequest++;
103
- return new InterstitialAd('interstitial', 'RNGoogleMobileAdsInterstitialModule', requestId, adUnitId, options);
105
+ return new InterstitialAd('interstitial', requestId, adUnitId, _NativeInterstitialModule.default.interstitialLoad, _NativeInterstitialModule.default.interstitialShow, options);
104
106
  }
105
107
  addAdEventsListener(listener) {
106
108
  return this._addAdEventsListener(listener);
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_validateAdRequestOptions","_MobileAd","InterstitialAd","MobileAd","_interstitialRequest","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","e","message","requestId","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener","exports"],"sourceRoot":"../../../src","sources":["ads/InterstitialAd.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,cAAc,SAASC,kBAAQ,CAAC;EAC3C,OAAiBC,oBAAoB,GAAG,CAAC;EACzC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,kBAAkBA,CAACC,QAAgB,EAAEC,cAA+B,EAAE;IAC3E,IAAI,CAAC,IAAAC,gBAAQ,EAACF,QAAQ,CAAC,EAAE;MACvB,MAAM,IAAIG,KAAK,CAAC,2EAA2E,CAAC;IAC9F;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,CAAC,2CAA2CG,CAAC,CAACC,OAAO,GAAG,CAAC;MAC1E;IACF;IAEA,MAAMC,SAAS,GAAGZ,cAAc,CAACE,oBAAoB,EAAE;IACvD,OAAO,IAAIF,cAAc,CACvB,cAAc,EACd,qCAAqC,EACrCY,SAAS,EACTR,QAAQ,EACRI,OACF,CAAC;EACH;EAEAK,mBAAmBA,CAAwBC,QAA6B,EAAE;IACxE,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkBA,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAACK,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","_validateAdRequestOptions","_MobileAd","_NativeInterstitialModule","_interopRequireDefault","e","__esModule","default","InterstitialAd","MobileAd","_interstitialRequest","createForAdRequest","adUnitId","requestOptions","isString","Error","options","validateAdRequestOptions","message","requestId","NativeInterstitialModule","interstitialLoad","interstitialShow","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener","exports"],"sourceRoot":"../../../src","sources":["ads/InterstitialAd.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OA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AC;EACH;EAEAO,mBAAmBA,CAAwBC,QAA6B,EAAE;IACxE,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkBA,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAACK,OAAA,CAAArB,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MobileAd = void 0;
7
- var _reactNative = require("react-native");
8
7
  var _common = require("../common");
9
8
  var _NativeError = require("../internal/NativeError");
10
9
  var _AdEventType = require("../AdEventType");
@@ -30,11 +29,12 @@ var _validateAdShowOptions = require("../validateAdShowOptions");
30
29
  */
31
30
 
32
31
  class MobileAd {
33
- constructor(type, nativeModule, requestId, adUnitId, requestOptions) {
32
+ constructor(type, requestId, adUnitId, adLoadFunction, adShowFunction, requestOptions) {
34
33
  this._type = type;
35
- this._nativeModule = nativeModule;
36
34
  this._requestId = requestId;
37
35
  this._adUnitId = adUnitId;
36
+ this._adLoadFunction = adLoadFunction;
37
+ this._adShowFunction = adShowFunction;
38
38
  this._requestOptions = requestOptions;
39
39
  this._loaded = false;
40
40
  this._isLoadCalled = false;
@@ -112,25 +112,13 @@ class MobileAd {
112
112
  get _className() {
113
113
  return this.constructor.name;
114
114
  }
115
- get _camelCaseType() {
116
- let type;
117
- if (this._type === 'app_open') {
118
- type = 'appOpen';
119
- } else if (this._type === 'rewarded_interstitial') {
120
- type = 'rewardedInterstitial';
121
- } else {
122
- type = this._type;
123
- }
124
- return type;
125
- }
126
115
  load() {
127
116
  // Prevent multiple load calls
128
117
  if (this._loaded || this._isLoadCalled) {
129
118
  return;
130
119
  }
131
120
  this._isLoadCalled = true;
132
- const load = _reactNative.NativeModules[this._nativeModule][`${this._camelCaseType}Load`];
133
- load(this._requestId, this._adUnitId, this._requestOptions);
121
+ this._adLoadFunction(this._requestId, this._adUnitId, this._requestOptions);
134
122
  }
135
123
  show(showOptions) {
136
124
  if (!this._loaded) {
@@ -146,8 +134,7 @@ class MobileAd {
146
134
  throw e;
147
135
  }
148
136
  }
149
- const show = _reactNative.NativeModules[this._nativeModule][`${this._camelCaseType}Show`];
150
- return show(this._requestId, this._adUnitId, options);
137
+ return this._adShowFunction(this._requestId, this._adUnitId, options);
151
138
  }
152
139
  removeAllListeners() {
153
140
  this._adEventsListeners.clear();