react-native-google-mobile-ads 14.4.2 → 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 (142) hide show
  1. package/README.md +15 -10
  2. package/__tests__/googleMobileAds.test.ts +1 -1
  3. package/__tests__/interstitial.test.ts +9 -23
  4. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt +6 -1
  5. package/docs/displaying-ads.mdx +20 -3
  6. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.h +36 -0
  7. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.mm +100 -0
  8. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.h +4 -0
  9. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +6 -1
  10. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +2 -0
  11. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.h +53 -0
  12. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.mm +220 -0
  13. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +36 -0
  14. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.mm +80 -0
  15. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.h +36 -0
  16. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.mm +102 -0
  17. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.h +37 -0
  18. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.mm +102 -0
  19. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.h +36 -0
  20. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.mm +100 -0
  21. package/jest.setup.ts +8 -5
  22. package/lib/commonjs/MobileAds.js +1 -1
  23. package/lib/commonjs/ads/AppOpenAd.js +3 -1
  24. package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
  25. package/lib/commonjs/ads/BannerAd.js +1 -1
  26. package/lib/commonjs/ads/BannerAd.js.map +1 -1
  27. package/lib/commonjs/ads/BaseAd.js +1 -1
  28. package/lib/commonjs/ads/GAMBannerAd.js +1 -1
  29. package/lib/commonjs/ads/GAMBannerAd.js.map +1 -1
  30. package/lib/commonjs/ads/InterstitialAd.js +3 -1
  31. package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
  32. package/lib/commonjs/ads/MobileAd.js +5 -18
  33. package/lib/commonjs/ads/MobileAd.js.map +1 -1
  34. package/lib/commonjs/ads/RewardedAd.js +3 -1
  35. package/lib/commonjs/ads/RewardedAd.js.map +1 -1
  36. package/lib/commonjs/ads/RewardedInterstitialAd.js +3 -1
  37. package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -1
  38. package/lib/commonjs/specs/components/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
  39. package/lib/commonjs/specs/modules/NativeAppOpenModule.js +25 -0
  40. package/lib/commonjs/specs/modules/NativeAppOpenModule.js.map +1 -0
  41. package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js +25 -0
  42. package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
  43. package/lib/commonjs/specs/modules/NativeInterstitialModule.js +25 -0
  44. package/lib/commonjs/specs/modules/NativeInterstitialModule.js.map +1 -0
  45. package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js +25 -0
  46. package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
  47. package/lib/commonjs/specs/modules/NativeRewardedModule.js +25 -0
  48. package/lib/commonjs/specs/modules/NativeRewardedModule.js.map +1 -0
  49. package/lib/commonjs/version.js +1 -1
  50. package/lib/module/MobileAds.js +1 -1
  51. package/lib/module/MobileAds.js.map +1 -1
  52. package/lib/module/ads/AppOpenAd.js +2 -1
  53. package/lib/module/ads/AppOpenAd.js.map +1 -1
  54. package/lib/module/ads/BannerAd.js +1 -1
  55. package/lib/module/ads/BannerAd.js.map +1 -1
  56. package/lib/module/ads/BaseAd.js +1 -1
  57. package/lib/module/ads/BaseAd.js.map +1 -1
  58. package/lib/module/ads/GAMBannerAd.js +1 -1
  59. package/lib/module/ads/GAMBannerAd.js.map +1 -1
  60. package/lib/module/ads/InterstitialAd.js +3 -1
  61. package/lib/module/ads/InterstitialAd.js.map +1 -1
  62. package/lib/module/ads/MobileAd.js +5 -18
  63. package/lib/module/ads/MobileAd.js.map +1 -1
  64. package/lib/module/ads/RewardedAd.js +3 -1
  65. package/lib/module/ads/RewardedAd.js.map +1 -1
  66. package/lib/module/ads/RewardedInterstitialAd.js +3 -1
  67. package/lib/module/ads/RewardedInterstitialAd.js.map +1 -1
  68. package/lib/module/specs/components/GoogleMobileAdsBannerViewNativeComponent.js.map +1 -0
  69. package/lib/module/specs/modules/NativeAppOpenModule.js +20 -0
  70. package/lib/module/specs/modules/NativeAppOpenModule.js.map +1 -0
  71. package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js +20 -0
  72. package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
  73. package/lib/module/specs/modules/NativeInterstitialModule.js +20 -0
  74. package/lib/module/specs/modules/NativeInterstitialModule.js.map +1 -0
  75. package/lib/module/specs/modules/NativeRewardedInterstitialModule.js +20 -0
  76. package/lib/module/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
  77. package/lib/module/specs/modules/NativeRewardedModule.js +20 -0
  78. package/lib/module/specs/modules/NativeRewardedModule.js.map +1 -0
  79. package/lib/module/version.js +1 -1
  80. package/lib/typescript/ads/AppOpenAd.d.ts.map +1 -1
  81. package/lib/typescript/ads/BannerAd.d.ts.map +1 -1
  82. package/lib/typescript/ads/BaseAd.d.ts +1 -1
  83. package/lib/typescript/ads/BaseAd.d.ts.map +1 -1
  84. package/lib/typescript/ads/GAMBannerAd.d.ts.map +1 -1
  85. package/lib/typescript/ads/InterstitialAd.d.ts.map +1 -1
  86. package/lib/typescript/ads/MobileAd.d.ts +5 -4
  87. package/lib/typescript/ads/MobileAd.d.ts.map +1 -1
  88. package/lib/typescript/ads/RewardedAd.d.ts.map +1 -1
  89. package/lib/typescript/ads/RewardedInterstitialAd.d.ts.map +1 -1
  90. package/lib/typescript/index.d.ts +1 -1
  91. package/lib/typescript/specs/components/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +1 -0
  92. package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts +25 -0
  93. package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts.map +1 -0
  94. package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts +30 -0
  95. package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts.map +1 -0
  96. package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts +25 -0
  97. package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts.map +1 -0
  98. package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts +25 -0
  99. package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts.map +1 -0
  100. package/lib/typescript/specs/modules/NativeRewardedModule.d.ts +25 -0
  101. package/lib/typescript/specs/modules/NativeRewardedModule.d.ts.map +1 -0
  102. package/lib/typescript/version.d.ts +1 -1
  103. package/package.json +2 -2
  104. package/src/MobileAds.ts +1 -1
  105. package/src/ads/AppOpenAd.ts +3 -1
  106. package/src/ads/BannerAd.tsx +3 -1
  107. package/src/ads/BaseAd.tsx +2 -2
  108. package/src/ads/GAMBannerAd.tsx +3 -1
  109. package/src/ads/InterstitialAd.ts +3 -1
  110. package/src/ads/MobileAd.ts +9 -25
  111. package/src/ads/RewardedAd.ts +3 -1
  112. package/src/ads/RewardedInterstitialAd.ts +3 -1
  113. package/src/specs/modules/NativeAppOpenModule.ts +26 -0
  114. package/src/specs/modules/NativeGoogleMobileAdsModule.ts +33 -0
  115. package/src/specs/modules/NativeInterstitialModule.ts +26 -0
  116. package/src/specs/modules/NativeRewardedInterstitialModule.ts +32 -0
  117. package/src/specs/modules/NativeRewardedModule.ts +26 -0
  118. package/src/version.ts +1 -1
  119. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +0 -46
  120. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.swift +0 -85
  121. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.swift +0 -231
  122. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.swift +0 -76
  123. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +0 -46
  124. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.swift +0 -123
  125. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.m +0 -46
  126. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.swift +0 -85
  127. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +0 -46
  128. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.swift +0 -85
  129. package/lib/commonjs/NativeGoogleMobileAdsModule.js +0 -9
  130. package/lib/commonjs/NativeGoogleMobileAdsModule.js.map +0 -1
  131. package/lib/commonjs/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +0 -1
  132. package/lib/module/NativeGoogleMobileAdsModule.js +0 -3
  133. package/lib/module/NativeGoogleMobileAdsModule.js.map +0 -1
  134. package/lib/module/ads/GoogleMobileAdsBannerViewNativeComponent.js.map +0 -1
  135. package/lib/typescript/NativeGoogleMobileAdsModule.d.ts +0 -14
  136. package/lib/typescript/NativeGoogleMobileAdsModule.d.ts.map +0 -1
  137. package/lib/typescript/ads/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +0 -1
  138. package/src/NativeGoogleMobileAdsModule.ts +0 -16
  139. /package/lib/commonjs/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.js +0 -0
  140. /package/lib/module/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.js +0 -0
  141. /package/lib/typescript/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.d.ts +0 -0
  142. /package/src/{ads → specs/components}/GoogleMobileAdsBannerViewNativeComponent.ts +0 -0
@@ -1,76 +0,0 @@
1
- #if !targetEnvironment(macCatalyst)
2
-
3
- import Foundation
4
- import GoogleMobileAds
5
-
6
- class RNGoogleMobileAdsFullScreenContentDelegate: NSObject, GADFullScreenContentDelegate, GADAppEventDelegate {
7
- let adEventName: String
8
- let requestId: Int
9
- let adUnitId: String
10
-
11
- init(adEventName: String, requestId: Int, adUnitId: String) {
12
- self.adEventName = adEventName
13
- self.requestId = requestId
14
- self.adUnitId = adUnitId
15
- }
16
-
17
- func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
18
- sendAdEvent(
19
- type: GOOGLE_MOBILE_ADS_EVENT_OPENED,
20
- error: nil,
21
- data: nil
22
- )
23
- }
24
-
25
- func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
26
- sendAdEvent(
27
- type: GOOGLE_MOBILE_ADS_EVENT_ERROR,
28
- error: RNGoogleMobileAdsCommon.getCodeAndMessage(fromAdError: error) as? Dictionary<String, Any>,
29
- data: nil
30
- )
31
- }
32
-
33
- func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
34
- sendAdEvent(
35
- type: GOOGLE_MOBILE_ADS_EVENT_CLOSED,
36
- error: nil,
37
- data: nil
38
- )
39
- }
40
-
41
- func adDidRecordClick(_ ad: GADFullScreenPresentingAd) {
42
- sendAdEvent(
43
- type: GOOGLE_MOBILE_ADS_EVENT_CLICKED,
44
- error: nil,
45
- data: nil
46
- )
47
- }
48
-
49
- func adDidRecordImpression(_ ad: GADFullScreenPresentingAd) {
50
- // Not implemented yet
51
- }
52
-
53
- func interstitialAd(_ interstitialAd: GADInterstitialAd, didReceiveAppEvent name: String, withInfo info: String?) {
54
- sendAdEvent(
55
- type: GOOGLE_MOBILE_ADS_EVENT_APP_EVENT,
56
- error: nil,
57
- data: [
58
- "name": name,
59
- "data": info ?? ""
60
- ]
61
- )
62
- }
63
-
64
- private func sendAdEvent(type: String, error: Dictionary<String, Any>?, data: Dictionary<String, Any>?) {
65
- RNGoogleMobileAdsCommon.sendAdEvent(
66
- adEventName,
67
- requestId: requestId as NSNumber,
68
- type: type,
69
- adUnitId: adUnitId,
70
- error: error,
71
- data: data
72
- )
73
- }
74
- }
75
-
76
- #endif
@@ -1,46 +0,0 @@
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 <React/RCTBridgeModule.h>
21
-
22
- @interface RCT_EXTERN_MODULE (RNGoogleMobileAdsInterstitialModule, NSObject)
23
-
24
- - (dispatch_queue_t)methodQueue {
25
- return dispatch_get_main_queue();
26
- }
27
-
28
- + (BOOL)requiresMainQueueSetup {
29
- return YES;
30
- }
31
-
32
- RCT_EXTERN_METHOD(interstitialLoad
33
- : (nonnull NSNumber *)requestId forAdUnitId
34
- : (nonnull NSString *)adUnitId withAdRequestOptions
35
- : (nonnull NSDictionary *)adRequestOptions)
36
-
37
- RCT_EXTERN_METHOD(interstitialShow
38
- : (nonnull NSNumber *)requestId forAdUnitId
39
- : (nonnull NSString *)adUnitId withShowOptions
40
- : (NSDictionary *)showOptions withResolve
41
- : (RCTPromiseResolveBlock)resolve withReject
42
- : (RCTPromiseRejectBlock)reject)
43
-
44
- @end
45
-
46
- #endif
@@ -1,123 +0,0 @@
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 !targetEnvironment(macCatalyst)
19
-
20
- import Foundation
21
- import GoogleMobileAds
22
-
23
- @objc(RNGoogleMobileAdsInterstitialModule)
24
- class RNGoogleMobileAdsInterstitialModule: NSObject {
25
- let ad = RNGoogleMobileAdsInterstitialAd()
26
- let gamAd = RNGoogleMobileAdsGAMInterstitialAd()
27
-
28
- deinit {
29
- invalidate()
30
- }
31
-
32
- @objc
33
- func invalidate() {
34
- ad.invalidate()
35
- gamAd.invalidate()
36
- }
37
-
38
- @objc(interstitialLoad:forAdUnitId:withAdRequestOptions:)
39
- func interstitialLoad(
40
- requestId: NSNumber,
41
- adUnitId: String,
42
- adRequestOptions: Dictionary<String, Any>
43
- ) {
44
- if (RNGoogleMobileAdsCommon.isAdManagerUnit(adUnitId)) {
45
- gamAd.load(
46
- requestId: requestId.intValue,
47
- adUnitId: adUnitId,
48
- adRequestOptions: adRequestOptions
49
- )
50
- } else {
51
- ad.load(
52
- requestId: requestId.intValue,
53
- adUnitId: adUnitId,
54
- adRequestOptions: adRequestOptions
55
- )
56
- }
57
- }
58
-
59
- @objc(interstitialShow:forAdUnitId:withShowOptions:withResolve:withReject:)
60
- func interstitialShow(
61
- requestId: NSNumber,
62
- adUnitId: String,
63
- showOptions: Dictionary<String, Any>,
64
- resolve: RCTPromiseResolveBlock?,
65
- reject: RCTPromiseRejectBlock?
66
- ) {
67
- if (RNGoogleMobileAdsCommon.isAdManagerUnit(adUnitId)) {
68
- gamAd.show(
69
- requestId: requestId.intValue,
70
- adUnitId: adUnitId,
71
- showOptions: showOptions,
72
- resolve: resolve,
73
- reject: reject
74
- )
75
- } else {
76
- ad.show(
77
- requestId: requestId.intValue,
78
- adUnitId: adUnitId,
79
- showOptions: showOptions,
80
- resolve: resolve,
81
- reject: reject
82
- )
83
- }
84
- }
85
-
86
- class RNGoogleMobileAdsInterstitialAd: RNGoogleMobileAdsFullScreenAd<GADInterstitialAd> {
87
- override func getAdEventName() -> String {
88
- return GOOGLE_MOBILE_ADS_EVENT_INTERSTITIAL
89
- }
90
-
91
- override func loadAd(
92
- adUnitId: String,
93
- adRequest: GAMRequest,
94
- completionHandler: @escaping (GADInterstitialAd?, Error?) -> ()
95
- ) {
96
- GADInterstitialAd.load(
97
- withAdUnitID: adUnitId,
98
- request: adRequest,
99
- completionHandler: completionHandler
100
- )
101
- }
102
- }
103
-
104
- class RNGoogleMobileAdsGAMInterstitialAd: RNGoogleMobileAdsFullScreenAd<GAMInterstitialAd> {
105
- override func getAdEventName() -> String {
106
- return GOOGLE_MOBILE_ADS_EVENT_INTERSTITIAL
107
- }
108
-
109
- override func loadAd(
110
- adUnitId: String,
111
- adRequest: GAMRequest,
112
- completionHandler: @escaping (GAMInterstitialAd?, Error?) -> ()
113
- ) {
114
- GAMInterstitialAd.load(
115
- withAdManagerAdUnitID: adUnitId,
116
- request: adRequest,
117
- completionHandler: completionHandler
118
- )
119
- }
120
- }
121
- }
122
-
123
- #endif
@@ -1,46 +0,0 @@
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 <React/RCTBridgeModule.h>
21
-
22
- @interface RCT_EXTERN_MODULE (RNGoogleMobileAdsRewardedInterstitialModule, NSObject)
23
-
24
- - (dispatch_queue_t)methodQueue {
25
- return dispatch_get_main_queue();
26
- }
27
-
28
- + (BOOL)requiresMainQueueSetup {
29
- return YES;
30
- }
31
-
32
- RCT_EXTERN_METHOD(rewardedInterstitialLoad
33
- : (nonnull NSNumber *)requestId forAdUnitId
34
- : (nonnull NSString *)adUnitId withAdRequestOptions
35
- : (nonnull NSDictionary *)adRequestOptions)
36
-
37
- RCT_EXTERN_METHOD(rewardedInterstitialShow
38
- : (nonnull NSNumber *)requestId forAdUnitId
39
- : (nonnull NSString *)adUnitId withShowOptions
40
- : (NSDictionary *)showOptions withResolve
41
- : (RCTPromiseResolveBlock)resolve withReject
42
- : (RCTPromiseRejectBlock)reject)
43
-
44
- @end
45
-
46
- #endif
@@ -1,85 +0,0 @@
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 !targetEnvironment(macCatalyst)
19
-
20
- import Foundation
21
- import GoogleMobileAds
22
-
23
- @objc(RNGoogleMobileAdsRewardedInterstitialModule)
24
- class RNGoogleMobileAdsRewardedInterstitialModule: NSObject {
25
- let ad = RNGoogleMobileAdsRewardedInterstitialAd()
26
-
27
- deinit {
28
- invalidate()
29
- }
30
-
31
- @objc
32
- func invalidate() {
33
- ad.invalidate()
34
- }
35
-
36
- @objc(rewardedInterstitialLoad:forAdUnitId:withAdRequestOptions:)
37
- func rewardedInterstitialLoad(
38
- requestId: NSNumber,
39
- adUnitId: String,
40
- adRequestOptions: Dictionary<String, Any>
41
- ) {
42
- ad.load(
43
- requestId: requestId.intValue,
44
- adUnitId: adUnitId,
45
- adRequestOptions: adRequestOptions
46
- )
47
- }
48
-
49
- @objc(rewardedInterstitialShow:forAdUnitId:withShowOptions:withResolve:withReject:)
50
- func rewardedInterstitialShow(
51
- requestId: NSNumber,
52
- adUnitId: String,
53
- showOptions: Dictionary<String, Any>,
54
- resolve: RCTPromiseResolveBlock?,
55
- reject: RCTPromiseRejectBlock?
56
- ) {
57
- ad.show(
58
- requestId: requestId.intValue,
59
- adUnitId: adUnitId,
60
- showOptions: showOptions,
61
- resolve: resolve,
62
- reject: reject
63
- )
64
- }
65
-
66
- class RNGoogleMobileAdsRewardedInterstitialAd: RNGoogleMobileAdsFullScreenAd<GADRewardedInterstitialAd> {
67
- override func getAdEventName() -> String {
68
- return GOOGLE_MOBILE_ADS_EVENT_REWARDED_INTERSTITIAL
69
- }
70
-
71
- override func loadAd(
72
- adUnitId: String,
73
- adRequest: GAMRequest,
74
- completionHandler: @escaping (GADRewardedInterstitialAd?, Error?) -> ()
75
- ) {
76
- GADRewardedInterstitialAd.load(
77
- withAdUnitID: adUnitId,
78
- request: adRequest,
79
- completionHandler: completionHandler
80
- )
81
- }
82
- }
83
- }
84
-
85
- #endif
@@ -1,46 +0,0 @@
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 <React/RCTBridgeModule.h>
21
-
22
- @interface RCT_EXTERN_MODULE (RNGoogleMobileAdsRewardedModule, NSObject)
23
-
24
- - (dispatch_queue_t)methodQueue {
25
- return dispatch_get_main_queue();
26
- }
27
-
28
- + (BOOL)requiresMainQueueSetup {
29
- return YES;
30
- }
31
-
32
- RCT_EXTERN_METHOD(rewardedLoad
33
- : (nonnull NSNumber *)requestId forAdUnitId
34
- : (nonnull NSString *)adUnitId withAdRequestOptions
35
- : (nonnull NSDictionary *)adRequestOptions)
36
-
37
- RCT_EXTERN_METHOD(rewardedShow
38
- : (nonnull NSNumber *)requestId forAdUnitId
39
- : (nonnull NSString *)adUnitId withShowOptions
40
- : (NSDictionary *)showOptions withResolve
41
- : (RCTPromiseResolveBlock)resolve withReject
42
- : (RCTPromiseRejectBlock)reject)
43
-
44
- @end
45
-
46
- #endif
@@ -1,85 +0,0 @@
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 !targetEnvironment(macCatalyst)
19
-
20
- import Foundation
21
- import GoogleMobileAds
22
-
23
- @objc(RNGoogleMobileAdsRewardedModule)
24
- class RNGoogleMobileAdsRewardedModule: NSObject {
25
- let ad = RNGoogleMobileAdsRewardedAd()
26
-
27
- deinit {
28
- invalidate()
29
- }
30
-
31
- @objc
32
- func invalidate() {
33
- ad.invalidate()
34
- }
35
-
36
- @objc(rewardedLoad:forAdUnitId:withAdRequestOptions:)
37
- func rewardedLoad(
38
- requestId: NSNumber,
39
- adUnitId: String,
40
- adRequestOptions: Dictionary<String, Any>
41
- ) {
42
- ad.load(
43
- requestId: requestId.intValue,
44
- adUnitId: adUnitId,
45
- adRequestOptions: adRequestOptions
46
- )
47
- }
48
-
49
- @objc(rewardedShow:forAdUnitId:withShowOptions:withResolve:withReject:)
50
- func rewardedShow(
51
- requestId: NSNumber,
52
- adUnitId: String,
53
- showOptions: Dictionary<String, Any>,
54
- resolve: RCTPromiseResolveBlock?,
55
- reject: RCTPromiseRejectBlock?
56
- ) {
57
- ad.show(
58
- requestId: requestId.intValue,
59
- adUnitId: adUnitId,
60
- showOptions: showOptions,
61
- resolve: resolve,
62
- reject: reject
63
- )
64
- }
65
-
66
- class RNGoogleMobileAdsRewardedAd: RNGoogleMobileAdsFullScreenAd<GADRewardedAd> {
67
- override func getAdEventName() -> String {
68
- return GOOGLE_MOBILE_ADS_EVENT_REWARDED
69
- }
70
-
71
- override func loadAd(
72
- adUnitId: String,
73
- adRequest: GAMRequest,
74
- completionHandler: @escaping (GADRewardedAd?, Error?) -> ()
75
- ) {
76
- GADRewardedAd.load(
77
- withAdUnitID: adUnitId,
78
- request: adRequest,
79
- completionHandler: completionHandler
80
- )
81
- }
82
- }
83
- }
84
-
85
- #endif
@@ -1,9 +0,0 @@
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 = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('RNGoogleMobileAdsModule');
9
- //# sourceMappingURL=NativeGoogleMobileAdsModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeGoogleMobileAdsModule.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAcpCC,gCAAmB,CAACC,YAAY,CAAO,yBAAyB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","_codegenNativeCommands","e","__esModule","default","Commands","exports","codegenNativeCommands","supportedCommands","_default","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["ads/GoogleMobileAdsBannerViewNativeComponent.ts"],"mappings":";;;;;;AAGA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA8B3F;AACA;AACO,MAAMG,QAAwB,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,8BAAqB,EAAiB;EAC5EC,iBAAiB,EAAE,CAAC,wBAAwB,EAAE,MAAM;AACtD,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAH,OAAA,CAAAF,OAAA,GAEY,IAAAM,+BAAsB,EACnC,6BACF,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { TurboModuleRegistry } from 'react-native';
2
- export default TurboModuleRegistry.getEnforcing('RNGoogleMobileAdsModule');
3
- //# sourceMappingURL=NativeGoogleMobileAdsModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeGoogleMobileAdsModule.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAclD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,yBAAyB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../../src","sources":["ads/GoogleMobileAdsBannerViewNativeComponent.ts"],"mappings":"AAGA,OAAOA,sBAAsB,MAAM,yDAAyD;AAC5F,OAAOC,qBAAqB,MAAM,wDAAwD;AA8B1F;AACA;AACA,OAAO,MAAMC,QAAwB,GAAGD,qBAAqB,CAAiB;EAC5EE,iBAAiB,EAAE,CAAC,wBAAwB,EAAE,MAAM;AACtD,CAAC,CAAC;AAEF,eAAeH,sBAAsB,CACnC,6BACF,CAAC","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- import type { TurboModule } from 'react-native';
2
- import { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
3
- import { AdapterStatus } from './types';
4
- export interface Spec extends TurboModule {
5
- initialize(): Promise<AdapterStatus[]>;
6
- setRequestConfiguration(requestConfiguration?: UnsafeObject): Promise<void>;
7
- openAdInspector(): Promise<void>;
8
- openDebugMenu(adUnit: string): void;
9
- setAppVolume(volume: number): void;
10
- setAppMuted(muted: boolean): void;
11
- }
12
- declare const _default: Spec;
13
- export default _default;
14
- //# sourceMappingURL=NativeGoogleMobileAdsModule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeGoogleMobileAdsModule.d.ts","sourceRoot":"","sources":["../../src/NativeGoogleMobileAdsModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACvC,uBAAuB,CAAC,oBAAoB,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACnC;;AAED,wBAAiF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GoogleMobileAdsBannerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/ads/GoogleMobileAdsBannerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAI7F,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB,EAAE,OAAO,CAAC;IAClC,aAAa,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;CAClD;AAED,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEvD,UAAU,cAAc;IACtB,sBAAsB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC3E,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CAC1D;AAID,eAAO,MAAM,QAAQ,EAAE,cAErB,CAAC;wBAIE,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
@@ -1,16 +0,0 @@
1
- import type { TurboModule } from 'react-native';
2
- import { TurboModuleRegistry } from 'react-native';
3
- import { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
-
5
- import { AdapterStatus } from './types';
6
-
7
- export interface Spec extends TurboModule {
8
- initialize(): Promise<AdapterStatus[]>;
9
- setRequestConfiguration(requestConfiguration?: UnsafeObject): Promise<void>;
10
- openAdInspector(): Promise<void>;
11
- openDebugMenu(adUnit: string): void;
12
- setAppVolume(volume: number): void;
13
- setAppMuted(muted: boolean): void;
14
- }
15
-
16
- export default TurboModuleRegistry.getEnforcing<Spec>('RNGoogleMobileAdsModule');