react-native-daro 1.0.13 → 1.0.16

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 (262) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +30 -30
  3. package/android/build.gradle +52 -59
  4. package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +23 -0
  5. package/android/src/main/AndroidManifest.xml +1 -2
  6. package/android/src/main/java/com/{darom → daro/reactnative}/DaroMAdBannerViewManager.kt +38 -15
  7. package/android/src/main/java/com/daro/reactnative/DaroMAdNativeViewManager.kt +167 -0
  8. package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +257 -0
  9. package/android/src/main/java/com/daro/reactnative/DaroMPackage.kt +45 -0
  10. package/android/src/main/java/com/daro/reactnative/DaroMediaViewManager.kt +25 -0
  11. package/android/src/main/java/com/{darom → daro/reactnative}/constants/InternalDaroMBannerSize.kt +1 -1
  12. package/android/src/main/java/com/{darom → daro/reactnative}/event/DaroMEvent.kt +19 -8
  13. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMBannerViewModuleImpl.kt +2 -2
  14. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMInterstitialModuleImpl.kt +26 -26
  15. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMLightPopupModuleImpl.kt +30 -29
  16. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMRewardedAdModuleImpl.kt +27 -27
  17. package/android/src/main/java/com/{darom → daro/reactnative}/util/AdInfoUtil.kt +25 -1
  18. package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +37 -0
  19. package/android/src/main/java/com/daro/reactnative/view/DaroMAdBannerViewContainer.kt +417 -0
  20. package/android/src/main/java/com/daro/reactnative/view/DaroMAdNativeViewContainer.kt +624 -0
  21. package/android/src/main/java/com/daro/reactnative/view/DaroMediaView.kt +123 -0
  22. package/android/src/newarch/java/com/daro/reactnative/DaroMModuleSpec.kt +6 -0
  23. package/android/src/oldarch/java/com/daro/reactnative/DaroMModuleSpec.kt +90 -0
  24. package/app.plugin.js +1 -0
  25. package/ios/DaroMModule+AppOpen.swift +38 -32
  26. package/ios/DaroMModule+Interstitial.swift +32 -26
  27. package/ios/DaroMModule+LightPopup.swift +43 -33
  28. package/ios/DaroMModule+Rewarded.swift +38 -27
  29. package/ios/DaroMModule.mm +45 -17
  30. package/ios/DaroMModule.swift +24 -17
  31. package/ios/Fabric/DaroMAdBannerComponentView.mm +207 -0
  32. package/ios/Fabric/DaroMFabricEventSink.mm +31 -0
  33. package/ios/Fabric/DaroMFabricPropApplier.mm +123 -0
  34. package/ios/Fabric/DaroMNativeAdComponentView.mm +294 -0
  35. package/ios/{DaroMAdBannerViewManager.m → Paper/DaroMAdBannerViewManager.m} +3 -1
  36. package/ios/Paper/DaroMAdBannerViewManager.swift +21 -0
  37. package/ios/{DaroMNativeAdViewManager.m → Paper/DaroMNativeAdViewManager.m} +2 -1
  38. package/ios/Paper/DaroMNativeAdViewManager.swift +22 -0
  39. package/ios/Shared/DaroMAdEventSink.swift +24 -0
  40. package/ios/Shared/DaroMBannerAdView.swift +188 -0
  41. package/ios/Shared/DaroMNativeAdLoadCoordinator.swift +49 -0
  42. package/ios/Shared/DaroMNativeAdView.swift +575 -0
  43. package/ios/Shared/DaroMNativeAssetResolver.swift +53 -0
  44. package/ios/mediation/admob/DaroMediationDebugger.swift +11 -0
  45. package/ios/mediation/admob/DaroMediationTypes.swift +23 -0
  46. package/lib/commonjs/AdBannerView.js +21 -35
  47. package/lib/commonjs/AdBannerView.js.map +1 -1
  48. package/lib/commonjs/AppOpenAd.js +80 -21
  49. package/lib/commonjs/AppOpenAd.js.map +1 -1
  50. package/lib/commonjs/DaroMAdBannerViewNativeComponent.ts +47 -0
  51. package/lib/commonjs/DaroMNativeAdViewNativeComponent.ts +62 -0
  52. package/lib/commonjs/DaroMediaViewNativeComponent.ts +9 -0
  53. package/lib/commonjs/ErrorCode.js.map +1 -1
  54. package/lib/commonjs/EventEmitter.js +4 -5
  55. package/lib/commonjs/EventEmitter.js.map +1 -1
  56. package/lib/commonjs/InterstitialAd.js +48 -22
  57. package/lib/commonjs/InterstitialAd.js.map +1 -1
  58. package/lib/commonjs/LightPopupAd.js +64 -46
  59. package/lib/commonjs/LightPopupAd.js.map +1 -1
  60. package/lib/commonjs/NativeDaroModule.js +9 -0
  61. package/lib/commonjs/NativeDaroModule.js.map +1 -0
  62. package/lib/commonjs/RewardedAd.js +47 -23
  63. package/lib/commonjs/RewardedAd.js.map +1 -1
  64. package/lib/commonjs/codegen-env.d.js +2 -0
  65. package/lib/commonjs/codegen-env.d.js.map +1 -0
  66. package/lib/commonjs/hooks/useInterstitialAd.js +110 -0
  67. package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
  68. package/lib/commonjs/hooks/useLightPopupAd.js +114 -0
  69. package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -0
  70. package/lib/commonjs/hooks/useRewardedAd.js +113 -0
  71. package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
  72. package/lib/commonjs/index.js +29 -13
  73. package/lib/commonjs/index.js.map +1 -1
  74. package/lib/commonjs/nativeAd/NativeAdView.js +23 -18
  75. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  76. package/lib/commonjs/nativeAd/NativeAdViewComponents.js +43 -31
  77. package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
  78. package/lib/commonjs/nativeAd/NativeAdViewProvider.js +34 -7
  79. package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
  80. package/lib/commonjs/package.json +1 -0
  81. package/lib/module/AdBannerView.js +20 -36
  82. package/lib/module/AdBannerView.js.map +1 -1
  83. package/lib/module/AppOpenAd.js +80 -22
  84. package/lib/module/AppOpenAd.js.map +1 -1
  85. package/lib/module/DaroMAdBannerViewNativeComponent.ts +47 -0
  86. package/lib/module/DaroMNativeAdViewNativeComponent.ts +62 -0
  87. package/lib/module/DaroMediaViewNativeComponent.ts +9 -0
  88. package/lib/module/ErrorCode.js.map +1 -1
  89. package/lib/module/EventEmitter.js +4 -6
  90. package/lib/module/EventEmitter.js.map +1 -1
  91. package/lib/module/InterstitialAd.js +47 -22
  92. package/lib/module/InterstitialAd.js.map +1 -1
  93. package/lib/module/LightPopupAd.js +65 -47
  94. package/lib/module/LightPopupAd.js.map +1 -1
  95. package/lib/module/NativeDaroModule.js +5 -0
  96. package/lib/module/NativeDaroModule.js.map +1 -0
  97. package/lib/module/RewardedAd.js +46 -23
  98. package/lib/module/RewardedAd.js.map +1 -1
  99. package/lib/module/codegen-env.d.js +2 -0
  100. package/lib/module/codegen-env.d.js.map +1 -0
  101. package/lib/module/hooks/useInterstitialAd.js +106 -0
  102. package/lib/module/hooks/useInterstitialAd.js.map +1 -0
  103. package/lib/module/hooks/useLightPopupAd.js +110 -0
  104. package/lib/module/hooks/useLightPopupAd.js.map +1 -0
  105. package/lib/module/hooks/useRewardedAd.js +109 -0
  106. package/lib/module/hooks/useRewardedAd.js.map +1 -0
  107. package/lib/module/index.js +7 -13
  108. package/lib/module/index.js.map +1 -1
  109. package/lib/module/nativeAd/NativeAdView.js +22 -19
  110. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  111. package/lib/module/nativeAd/NativeAdViewComponents.js +45 -34
  112. package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
  113. package/lib/module/nativeAd/NativeAdViewProvider.js +35 -8
  114. package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
  115. package/lib/module/package.json +1 -0
  116. package/lib/typescript/commonjs/plugin/src/index.d.ts +19 -0
  117. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts +6 -0
  119. package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +8 -0
  121. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/plugin/src/withIos.d.ts +8 -0
  123. package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/src/AdBannerView.d.ts +126 -4
  125. package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/src/AppOpenAd.d.ts +6 -0
  127. package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
  129. package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
  131. package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts +6 -0
  133. package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/ErrorCode.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/EventEmitter.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/InterstitialAd.d.ts +6 -0
  137. package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/LightPopupAd.d.ts +6 -0
  139. package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +61 -0
  141. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/src/RewardedAd.d.ts +6 -0
  143. package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +19 -0
  145. package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +23 -0
  147. package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +20 -0
  149. package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/src/index.d.ts +7 -1
  151. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +125 -2
  153. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
  156. package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts +2 -2
  158. package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/src/types/AdProps.d.ts +2 -2
  161. package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +2 -0
  164. package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
  165. package/lib/typescript/module/plugin/src/index.d.ts +19 -0
  166. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  167. package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts +6 -0
  168. package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts.map +1 -0
  169. package/lib/typescript/module/plugin/src/withAndroid.d.ts +8 -0
  170. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  171. package/lib/typescript/module/plugin/src/withIos.d.ts +8 -0
  172. package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -0
  173. package/lib/typescript/module/src/AdBannerView.d.ts +126 -4
  174. package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
  175. package/lib/typescript/module/src/AppOpenAd.d.ts +6 -0
  176. package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
  177. package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
  178. package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
  179. package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
  180. package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
  181. package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts +6 -0
  182. package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
  183. package/lib/typescript/module/src/ErrorCode.d.ts.map +1 -1
  184. package/lib/typescript/module/src/EventEmitter.d.ts.map +1 -1
  185. package/lib/typescript/module/src/InterstitialAd.d.ts +6 -0
  186. package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
  187. package/lib/typescript/module/src/LightPopupAd.d.ts +6 -0
  188. package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
  189. package/lib/typescript/module/src/NativeDaroModule.d.ts +61 -0
  190. package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -0
  191. package/lib/typescript/module/src/RewardedAd.d.ts +6 -0
  192. package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
  193. package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +19 -0
  194. package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -0
  195. package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +23 -0
  196. package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -0
  197. package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +20 -0
  198. package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -0
  199. package/lib/typescript/module/src/index.d.ts +7 -1
  200. package/lib/typescript/module/src/index.d.ts.map +1 -1
  201. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +125 -2
  202. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
  203. package/lib/typescript/module/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  204. package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
  205. package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  206. package/lib/typescript/module/src/types/AdBannerViewProps.d.ts +2 -2
  207. package/lib/typescript/module/src/types/AdBannerViewProps.d.ts.map +1 -1
  208. package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
  209. package/lib/typescript/module/src/types/AdProps.d.ts +2 -2
  210. package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
  211. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +1 -1
  212. package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +2 -0
  213. package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
  214. package/package.json +95 -105
  215. package/plugin/build/index.d.ts +18 -0
  216. package/plugin/build/index.js +71 -0
  217. package/plugin/build/skAdNetworkIds.d.ts +5 -0
  218. package/plugin/build/skAdNetworkIds.js +205 -0
  219. package/plugin/build/withAndroid.d.ts +7 -0
  220. package/plugin/build/withAndroid.js +222 -0
  221. package/plugin/build/withIos.d.ts +7 -0
  222. package/plugin/build/withIos.js +82 -0
  223. package/react-native-daro.podspec +28 -0
  224. package/src/AdBannerView.tsx +48 -48
  225. package/src/AppOpenAd.ts +101 -20
  226. package/src/DaroMAdBannerViewNativeComponent.ts +47 -0
  227. package/src/DaroMNativeAdViewNativeComponent.ts +62 -0
  228. package/src/DaroMediaViewNativeComponent.ts +9 -0
  229. package/src/ErrorCode.ts +1 -2
  230. package/src/EventEmitter.ts +9 -7
  231. package/src/InterstitialAd.ts +75 -21
  232. package/src/LightPopupAd.ts +90 -51
  233. package/src/NativeDaroModule.ts +91 -0
  234. package/src/RewardedAd.ts +72 -22
  235. package/src/codegen-env.d.ts +45 -0
  236. package/src/hooks/useInterstitialAd.ts +117 -0
  237. package/src/hooks/useLightPopupAd.ts +132 -0
  238. package/src/hooks/useRewardedAd.ts +122 -0
  239. package/src/index.tsx +21 -22
  240. package/src/nativeAd/NativeAdView.tsx +83 -45
  241. package/src/nativeAd/NativeAdViewComponents.tsx +129 -64
  242. package/src/nativeAd/NativeAdViewProvider.tsx +84 -16
  243. package/src/types/AdBannerViewProps.ts +11 -11
  244. package/src/types/AdInfo.ts +17 -17
  245. package/src/types/AdProps.ts +8 -9
  246. package/src/types/DaroMMobileAds.ts +3 -6
  247. package/src/types/NativeAdViewProps.ts +12 -5
  248. package/src/types/index.ts +1 -1
  249. package/android/gradle.properties +0 -5
  250. package/android/src/main/AndroidManifestNew.xml +0 -7
  251. package/android/src/main/java/com/darom/DaroMAdNativeViewManager.kt +0 -136
  252. package/android/src/main/java/com/darom/DaroMModule.kt +0 -203
  253. package/android/src/main/java/com/darom/DaroMPackage.kt +0 -21
  254. package/android/src/main/java/com/darom/util/EventEmitterUtil.kt +0 -24
  255. package/android/src/main/java/com/darom/view/DaroMAdBannerViewContainer.kt +0 -163
  256. package/android/src/main/java/com/darom/view/DaroMAdNativeViewContainer.kt +0 -375
  257. package/android/src/main/res/layout/layout_activity_transparent.xml +0 -7
  258. package/android/src/main/res/values/styles.xml +0 -11
  259. package/ios/DaroM-Bridging-Header.h +0 -6
  260. package/ios/DaroMAdBannerViewManager.swift +0 -91
  261. package/ios/DaroMNativeAdViewManager.swift +0 -291
  262. package/react-native-daro-m.podspec +0 -44
@@ -1,31 +1,45 @@
1
- import { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react';
2
- import { findNodeHandle, NativeModules, requireNativeComponent, UIManager, View, type ViewProps } from 'react-native';
1
+ import {
2
+ forwardRef,
3
+ useCallback,
4
+ useContext,
5
+ useEffect,
6
+ useImperativeHandle,
7
+ useRef,
8
+ useState,
9
+ type ElementRef,
10
+ } from 'react';
11
+ import { View, type ViewProps } from 'react-native';
12
+ import NativeAdViewNativeComponent, {
13
+ Commands,
14
+ } from '../DaroMNativeAdViewNativeComponent';
15
+ import NativeDaroModule from '../NativeDaroModule';
3
16
  import type { AdNativeEvent } from '../types/AdEvent';
4
17
  import type { AdInfo, AdLoadFailedInfo } from '../types/AdInfo';
5
- import type { NativeAdViewHandler, NativeAdViewProps } from '../types/NativeAdViewProps';
6
- import { NativeAdViewContext, NativeAdViewProvider, type NativeAdViewContextType, type NativeAdViewType } from './NativeAdViewProvider';
7
-
8
- const { DaroMModule } = NativeModules;
9
-
10
- type NativeAdViewNativeEvents = {
11
- onAdLoadedEvent(event: AdNativeEvent<AdInfo>): void;
12
- onAdLoadFailedEvent(event: AdNativeEvent<AdLoadFailedInfo>): void;
13
- onAdClickedEvent(event: AdNativeEvent<AdInfo>): void;
14
- onAdImpressionRecordedEvent(event: AdNativeEvent<AdInfo>): void;
15
- };
16
-
17
- const ComponentName = 'DaroMNativeAdView';
18
- const NativeAdViewComponent = requireNativeComponent<NativeAdViewProps & ViewProps & NativeAdViewNativeEvents>(ComponentName);
19
-
20
- export const NativeAdView = forwardRef<NativeAdViewHandler, NativeAdViewProps & ViewProps>(function NativeAdView(props, ref) {
18
+ import type {
19
+ NativeAdViewHandler,
20
+ NativeAdViewProps,
21
+ } from '../types/NativeAdViewProps';
22
+ import {
23
+ NativeAdViewContext,
24
+ NativeAdViewProvider,
25
+ } from './NativeAdViewProvider';
26
+
27
+ type NativeAdViewElement = ElementRef<typeof NativeAdViewNativeComponent>;
28
+
29
+ export const NativeAdView = forwardRef<
30
+ NativeAdViewHandler,
31
+ NativeAdViewProps & ViewProps
32
+ >(function NativeAdView(props, ref) {
21
33
  const [isInitialized, setIsInitialized] = useState<boolean>(false);
22
34
 
23
35
  useEffect(() => {
24
36
  const checkInitialization = async () => {
25
- const result = await DaroMModule.isInitialized();
37
+ const result = await NativeDaroModule.isInitialized();
26
38
  setIsInitialized(result);
27
39
  if (!result) {
28
- console.warn('NativeAdView is mounted before the initialization of the DaroM React Native module.');
40
+ console.warn(
41
+ 'NativeAdView is mounted before the initialization of the DaroM React Native module.'
42
+ );
29
43
  }
30
44
  };
31
45
 
@@ -41,42 +55,43 @@ export const NativeAdView = forwardRef<NativeAdViewHandler, NativeAdViewProps &
41
55
  <NativeAdViewProvider>
42
56
  <NativeAdViewImpl {...props} ref={ref} />
43
57
  </NativeAdViewProvider>
44
- );
58
+ );
45
59
  });
46
60
 
47
- const NativeAdViewImpl = forwardRef<NativeAdViewHandler, NativeAdViewProps & ViewProps>(function NativeAdViewImpl(
48
- { adUnitId, onAdLoaded, onAdLoadFailed, onAdClicked, onAdImpressionRecorded, children, style, loadOnMount = true, ...otherProps },
61
+ const NativeAdViewImpl = forwardRef<
62
+ NativeAdViewHandler,
63
+ NativeAdViewProps & ViewProps
64
+ >(function NativeAdViewImpl(
65
+ {
66
+ adUnitId,
67
+ onAdLoaded,
68
+ onAdLoadFailed,
69
+ onAdClicked,
70
+ onAdImpressionRecorded,
71
+ children,
72
+ style,
73
+ loadOnMount = true,
74
+ adChoicesPosition = 'bottomRight',
75
+ ...otherProps
76
+ },
49
77
  ref
50
78
  ) {
51
- // Context provides functions to manage native ad and native ad view state
52
- const { setNativeAdView } = useContext(NativeAdViewContext) as NativeAdViewContextType;
53
-
54
- const nativeAdViewRef = useRef<NativeAdViewType | null>(null);
79
+ const { nativeAdAssetRegistrations } = useContext(NativeAdViewContext);
80
+ const nativeAdViewRef = useRef<NativeAdViewElement | null>(null);
55
81
 
56
82
  // Load a new ad
57
83
  const loadAd = useCallback(() => {
58
84
  if (nativeAdViewRef.current) {
59
- UIManager.dispatchViewManagerCommand(
60
- findNodeHandle(nativeAdViewRef.current),
61
- // @ts-ignore: Issue in RN ts defs
62
- UIManager.getViewManagerConfig(ComponentName).Commands.loadAd,
63
- [],
64
- );
85
+ Commands.loadAd(nativeAdViewRef.current);
65
86
  }
66
87
  }, []);
67
88
 
68
89
  useImperativeHandle(ref, () => ({ loadAd }), [loadAd]);
69
90
 
70
91
  // Save the DOM element reference
71
- const saveElement = useCallback(
72
- (element: NativeAdViewType | null) => {
73
- if (element) {
74
- nativeAdViewRef.current = element;
75
- setNativeAdView(element);
76
- }
77
- },
78
- [setNativeAdView]
79
- );
92
+ const saveElement = useCallback((element: NativeAdViewElement | null) => {
93
+ nativeAdViewRef.current = element;
94
+ }, []);
80
95
 
81
96
  const onAdLoadedEvent = useCallback(
82
97
  (event: AdNativeEvent<AdInfo>) => {
@@ -107,18 +122,41 @@ const NativeAdViewImpl = forwardRef<NativeAdViewHandler, NativeAdViewProps & Vie
107
122
  );
108
123
 
109
124
  return (
110
- <NativeAdViewComponent
125
+ <NativeAdViewNativeComponent
111
126
  ref={saveElement}
127
+ {...otherProps}
112
128
  adUnitId={adUnitId}
113
129
  loadOnMount={loadOnMount}
130
+ adChoicesPosition={adChoicesPosition}
131
+ titleView={nativeAdAssetRegistrations.titleView?.nativeTag ?? 0}
132
+ bodyView={nativeAdAssetRegistrations.bodyView?.nativeTag ?? 0}
133
+ callToActionView={
134
+ nativeAdAssetRegistrations.callToActionView?.nativeTag ?? 0
135
+ }
136
+ iconView={nativeAdAssetRegistrations.iconView?.nativeTag ?? 0}
137
+ mediaView={nativeAdAssetRegistrations.mediaView?.nativeTag ?? 0}
138
+ titleViewStyleProps={
139
+ nativeAdAssetRegistrations.titleView?.styleProps ?? null
140
+ }
141
+ bodyViewStyleProps={
142
+ nativeAdAssetRegistrations.bodyView?.styleProps ?? null
143
+ }
144
+ callToActionViewStyleProps={
145
+ nativeAdAssetRegistrations.callToActionView?.styleProps ?? null
146
+ }
147
+ iconViewStyleProps={
148
+ nativeAdAssetRegistrations.iconView?.styleProps ?? null
149
+ }
150
+ mediaViewStyleProps={
151
+ nativeAdAssetRegistrations.mediaView?.styleProps ?? null
152
+ }
114
153
  onAdLoadedEvent={onAdLoadedEvent}
115
154
  onAdLoadFailedEvent={onAdLoadFailedEvent}
116
155
  onAdClickedEvent={onAdClickedEvent}
117
156
  onAdImpressionRecordedEvent={onAdImpressionRecordedEvent}
118
157
  style={style}
119
- {...otherProps}
120
158
  >
121
159
  {children}
122
- </NativeAdViewComponent>
160
+ </NativeAdViewNativeComponent>
123
161
  );
124
162
  });
@@ -1,8 +1,36 @@
1
1
  import * as React from 'react';
2
- import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
3
- import type { ImageProps, StyleProp, TextProps, TextStyle, ImageStyle, ViewProps } from 'react-native';
4
- import { findNodeHandle, Image, Platform, Text, View } from 'react-native';
5
- import { NativeAdViewContext } from './NativeAdViewProvider';
2
+ import {
3
+ type ComponentRef,
4
+ useContext,
5
+ useLayoutEffect,
6
+ useMemo,
7
+ useRef,
8
+ } from 'react';
9
+ import type {
10
+ ImageProps,
11
+ StyleProp,
12
+ TextProps,
13
+ TextStyle,
14
+ ImageStyle,
15
+ ViewStyle,
16
+ ViewProps,
17
+ } from 'react-native';
18
+ import {
19
+ findNodeHandle,
20
+ Image,
21
+ Platform,
22
+ StyleSheet,
23
+ Text,
24
+ UIManager,
25
+ View,
26
+ } from 'react-native';
27
+ import {
28
+ NativeAdViewContext,
29
+ type NativeAdViewAssetPropKey,
30
+ } from './NativeAdViewProvider';
31
+ import DaroMediaViewNativeComponent from '../DaroMediaViewNativeComponent';
32
+
33
+ const UNREGISTERED_NATIVE_TAG = 0;
6
34
 
7
35
  // 스타일 속성 추출을 위한 타입 정의
8
36
  type StyleProps = {
@@ -53,41 +81,52 @@ type StyleProps = {
53
81
  };
54
82
 
55
83
  // 스타일 속성 추출 커스텀 훅
56
- const useStyleProps = (style: StyleProp<TextStyle>): StyleProps => {
84
+ const useStyleProps = (
85
+ style: StyleProp<TextStyle | ViewStyle>,
86
+ textProps?: Pick<TextProps, 'numberOfLines' | 'ellipsizeMode'>
87
+ ): StyleProps => {
57
88
  return useMemo(() => {
58
- const styleObj = style as TextStyle;
89
+ const styleObj = (StyleSheet.flatten(style) ?? {}) as TextStyle & ViewStyle;
90
+
59
91
  return {
60
92
  // 1. 폰트 관련
61
93
  fontSize: styleObj.fontSize as number,
62
94
  fontWeight: styleObj.fontWeight as string,
63
95
  fontFamily: styleObj.fontFamily as string,
64
96
  color: styleObj.color as string,
65
-
97
+
66
98
  // 2. 배경색
67
99
  backgroundColor: styleObj.backgroundColor as string,
68
-
100
+
69
101
  // 3. 정렬
70
- textAlign: styleObj.textAlign as 'auto' | 'left' | 'right' | 'center' | 'justify',
71
-
102
+ textAlign: styleObj.textAlign as
103
+ | 'auto'
104
+ | 'left'
105
+ | 'right'
106
+ | 'center'
107
+ | 'justify',
108
+ numberOfLines: textProps?.numberOfLines,
109
+ lineBreakMode: textProps?.ellipsizeMode as StyleProps['lineBreakMode'],
110
+
72
111
  // 6. 투명도
73
112
  opacity: styleObj.opacity as number,
74
-
113
+
75
114
  // 7. 숨김
76
115
  display: styleObj.display as 'none' | 'flex',
77
-
116
+
78
117
  // 10. 모서리 둥글게
79
118
  borderRadius: styleObj.borderRadius as number,
80
-
119
+
81
120
  // 11. 테두리
82
121
  borderWidth: styleObj.borderWidth as number,
83
122
  borderColor: styleObj.borderColor as string,
84
-
123
+
85
124
  // 12. 그림자
86
125
  shadowColor: styleObj.shadowColor as string,
87
126
  shadowOffset: styleObj.shadowOffset as { width: number; height: number },
88
127
  shadowOpacity: styleObj.shadowOpacity as number,
89
128
  shadowRadius: styleObj.shadowRadius as number,
90
-
129
+
91
130
  // 13. 여백
92
131
  padding: styleObj.padding as number,
93
132
  margin: styleObj.margin as number,
@@ -99,27 +138,27 @@ const useStyleProps = (style: StyleProp<TextStyle>): StyleProps => {
99
138
  marginRight: styleObj.marginRight as number,
100
139
  marginBottom: styleObj.marginBottom as number,
101
140
  marginLeft: styleObj.marginLeft as number,
102
-
141
+
103
142
  // 14. 위치
104
143
  position: styleObj.position as 'absolute' | 'relative',
105
144
  top: styleObj.top as number,
106
145
  right: styleObj.right as number,
107
146
  bottom: styleObj.bottom as number,
108
147
  left: styleObj.left as number,
109
-
148
+
110
149
  // 15. 크기
111
- width: styleObj.width as number,
112
- height: styleObj.height as number,
113
-
150
+ width: styleObj.width as number | string,
151
+ height: styleObj.height as number | string,
152
+
114
153
  // 16. 변환
115
154
  transform: styleObj.transform as any[],
116
-
155
+
117
156
  // 17. 기타
118
157
  zIndex: styleObj.zIndex as number,
119
158
  overflow: styleObj.overflow as 'visible' | 'hidden' | 'scroll',
120
159
  backfaceVisibility: styleObj.backfaceVisibility as 'visible' | 'hidden',
121
160
  };
122
- }, [style]);
161
+ }, [style, textProps?.ellipsizeMode, textProps?.numberOfLines]);
123
162
  };
124
163
 
125
164
  // Image 스타일 속성을 위한 타입 정의 추가
@@ -138,7 +177,8 @@ type ImageStyleProps = StyleProps & {
138
177
  // Image 스타일 속성 추출 커스텀 훅
139
178
  const useImageStyleProps = (style: StyleProp<ImageStyle>): ImageStyleProps => {
140
179
  return useMemo(() => {
141
- const styleObj = style as ImageStyle;
180
+ const styleObj = StyleSheet.flatten(style) ?? {};
181
+
142
182
  return {
143
183
  // 기본 스타일 속성
144
184
  backgroundColor: styleObj.backgroundColor as string,
@@ -151,11 +191,16 @@ const useImageStyleProps = (style: StyleProp<ImageStyle>): ImageStyleProps => {
151
191
  shadowOpacity: styleObj.shadowOpacity as number,
152
192
  shadowRadius: styleObj.shadowRadius as number,
153
193
 
154
- width: styleObj.width as number,
155
- height: styleObj.height as number,
194
+ width: styleObj.width as number | string,
195
+ height: styleObj.height as number | string,
156
196
 
157
197
  // Image 전용 스타일 속성
158
- resizeMode: styleObj.resizeMode as 'cover' | 'contain' | 'stretch' | 'repeat' | 'center',
198
+ resizeMode: styleObj.resizeMode as
199
+ | 'cover'
200
+ | 'contain'
201
+ | 'stretch'
202
+ | 'repeat'
203
+ | 'center',
159
204
  tintColor: styleObj.tintColor as string,
160
205
  overlayColor: styleObj.overlayColor as string,
161
206
  aspectRatio: styleObj.aspectRatio as number,
@@ -163,37 +208,47 @@ const useImageStyleProps = (style: StyleProp<ImageStyle>): ImageStyleProps => {
163
208
  }, [style]);
164
209
  };
165
210
 
166
- // 네이티브 속성 설정 커스텀 훅
167
- const useNativeAdViewProps = (ref: React.RefObject<any>, nativePropKey: string, styleProps?: StyleProps) => {
168
- const { nativeAdView } = useContext(NativeAdViewContext);
211
+ type NativeAdAssetStyleProps = StyleProps | ImageStyleProps;
212
+
213
+ // 네이티브 광고 자산 등록 커스텀 훅
214
+ const useNativeAdAssetRegistration = (
215
+ ref: React.RefObject<any>,
216
+ nativePropKey: NativeAdViewAssetPropKey,
217
+ styleProps?: NativeAdAssetStyleProps
218
+ ) => {
219
+ const { registerNativeAdAsset, unregisterNativeAdAsset } =
220
+ useContext(NativeAdViewContext);
221
+
222
+ useLayoutEffect(() => {
223
+ const nativeTag = ref.current
224
+ ? (findNodeHandle(ref.current) ?? UNREGISTERED_NATIVE_TAG)
225
+ : UNREGISTERED_NATIVE_TAG;
169
226
 
170
- const setNativeProps = useCallback(() => {
171
- if (!ref.current) return;
172
- const props: any = {
173
- [nativePropKey]: findNodeHandle(ref.current),
227
+ registerNativeAdAsset(nativePropKey, nativeTag, styleProps ?? null);
228
+ }, [nativePropKey, ref, registerNativeAdAsset, styleProps]);
229
+
230
+ useLayoutEffect(() => {
231
+ return () => {
232
+ unregisterNativeAdAsset(nativePropKey);
174
233
  };
175
-
176
- if (styleProps) {
177
- props[`${nativePropKey}StyleProps`] = styleProps;
178
- }
179
-
180
- nativeAdView?.setNativeProps(props);
181
- }, [nativeAdView, ref, nativePropKey, styleProps]);
182
-
183
- useEffect(() => {
184
- setNativeProps();
185
- }, [setNativeProps]);
234
+ }, [nativePropKey, unregisterNativeAdAsset]);
186
235
  };
187
236
 
188
237
  // 공통 Text 컴포넌트
189
- const AdTextView = (props: TextProps & { nativePropKey: string }) => {
190
- const { nativePropKey, ...restProps } = props;
191
- const textRef = useRef<Text | null>(null);
192
- const styleProps = useStyleProps(props.style);
193
-
194
- useNativeAdViewProps(textRef, nativePropKey, styleProps);
195
-
196
- return <Text {...restProps} ref={textRef} />;
238
+ const AdTextView = (
239
+ props: TextProps & { nativePropKey: NativeAdViewAssetPropKey }
240
+ ) => {
241
+ const { nativePropKey, children, ...restProps } = props;
242
+ const textRef = useRef<ComponentRef<typeof Text> | null>(null);
243
+ const styleProps = useStyleProps(props.style, props);
244
+
245
+ useNativeAdAssetRegistration(textRef, nativePropKey, styleProps);
246
+
247
+ return (
248
+ <Text {...restProps} ref={textRef}>
249
+ {children ?? (Platform.OS === 'android' ? ' ' : undefined)}
250
+ </Text>
251
+ );
197
252
  };
198
253
 
199
254
  export const TitleView = (props: TextProps) => {
@@ -205,14 +260,19 @@ export const BodyView = (props: TextProps) => {
205
260
  };
206
261
 
207
262
  export const CallToActionView = (props: TextProps) => {
208
- const callToActionRef = useRef<Text | null>(null);
209
- const styleProps = useStyleProps(props.style);
210
-
211
- useNativeAdViewProps(callToActionRef, 'callToActionView', styleProps);
212
-
263
+ const { children, ...restProps } = props;
264
+ const callToActionRef = useRef<ComponentRef<typeof Text> | null>(null);
265
+ const styleProps = useStyleProps(props.style, props);
266
+
267
+ useNativeAdAssetRegistration(callToActionRef, 'callToActionView', styleProps);
268
+
213
269
  // TouchableOpacity disables clicking on certain Android devices.
214
270
  if (Platform.OS === 'android') {
215
- return <Text {...props} ref={callToActionRef} />;
271
+ return (
272
+ <Text {...restProps} ref={callToActionRef}>
273
+ {children ?? ' '}
274
+ </Text>
275
+ );
216
276
  } else {
217
277
  return (
218
278
  <View>
@@ -223,17 +283,22 @@ export const CallToActionView = (props: TextProps) => {
223
283
  };
224
284
 
225
285
  export const IconView = (props: Omit<ImageProps, 'source'>) => {
226
- const imageRef = useRef<Image | null>(null);
286
+ const imageRef = useRef<ComponentRef<typeof Image> | null>(null);
227
287
  const iconViewStyleProps = useImageStyleProps(props.style);
228
- useNativeAdViewProps(imageRef, 'iconView', iconViewStyleProps);
288
+ useNativeAdAssetRegistration(imageRef, 'iconView', iconViewStyleProps);
229
289
 
230
290
  return <Image {...props} ref={imageRef} source={0} />;
231
291
  };
232
292
 
293
+ const NativeMediaView =
294
+ Platform.OS === 'android' && UIManager.hasViewManagerConfig?.('DaroMediaView')
295
+ ? DaroMediaViewNativeComponent
296
+ : View;
297
+
233
298
  export const MediaView = (props: ViewProps) => {
234
- const viewRef = useRef<View | null>(null);
235
- useNativeAdViewProps(viewRef, 'mediaView');
299
+ const viewRef = useRef<ComponentRef<typeof View> | null>(null);
300
+ const mediaViewStyleProps = useStyleProps(props.style);
301
+ useNativeAdAssetRegistration(viewRef, 'mediaView', mediaViewStyleProps);
236
302
 
237
- return <View {...props} ref={viewRef} />;
303
+ return <NativeMediaView {...props} ref={viewRef} collapsable={false} />;
238
304
  };
239
-
@@ -1,32 +1,100 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import * as React from 'react';
3
- import { createContext, useState } from 'react';
4
- import type { NativeMethods } from 'react-native';
5
- import type { NativeAdViewProps } from '../types/NativeAdViewProps';
3
+ import { createContext, useCallback, useMemo, useState } from 'react';
6
4
 
7
- export type NativeAdViewType = React.Component<NativeAdViewProps> & NativeMethods;
5
+ type NativeAdAssetStyleProps = object | null;
8
6
 
9
- export type NativeAdViewContextType = {
10
- nativeAdView: NativeAdViewType | null;
11
- setNativeAdView: React.Dispatch<React.SetStateAction<NativeAdViewType | null>>;
7
+ type NativeAdAssetRegistration = {
8
+ nativeTag: number;
9
+ styleProps: NativeAdAssetStyleProps;
12
10
  };
13
11
 
12
+ export type NativeAdViewAssetPropKey =
13
+ | 'titleView'
14
+ | 'bodyView'
15
+ | 'callToActionView'
16
+ | 'iconView'
17
+ | 'mediaView';
18
+
19
+ export type NativeAdAssetRegistrations = Partial<
20
+ Record<NativeAdViewAssetPropKey, NativeAdAssetRegistration>
21
+ >;
22
+
23
+ export type NativeAdViewContextType = {
24
+ nativeAdAssetRegistrations: NativeAdAssetRegistrations;
25
+ registerNativeAdAsset: (
26
+ assetKey: NativeAdViewAssetPropKey,
27
+ nativeTag: number,
28
+ styleProps: NativeAdAssetStyleProps
29
+ ) => void;
30
+ unregisterNativeAdAsset: (assetKey: NativeAdViewAssetPropKey) => void;
31
+ };
14
32
 
15
33
  export const NativeAdViewContext = createContext<NativeAdViewContextType>({
16
- nativeAdView: null,
17
- setNativeAdView: () => { },
34
+ nativeAdAssetRegistrations: {},
35
+ registerNativeAdAsset: () => {},
36
+ unregisterNativeAdAsset: () => {},
18
37
  });
19
38
 
20
- export const NativeAdViewProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
21
- const [nativeAdView, setNativeAdView] = useState<NativeAdViewType | null>(null);
39
+ export const NativeAdViewProvider: React.FC<{ children: ReactNode }> = ({
40
+ children,
41
+ }) => {
42
+ const [nativeAdAssetRegistrations, setNativeAdAssetRegistrations] =
43
+ useState<NativeAdAssetRegistrations>({});
44
+
45
+ const registerNativeAdAsset = useCallback(
46
+ (
47
+ assetKey: NativeAdViewAssetPropKey,
48
+ nativeTag: number,
49
+ styleProps: NativeAdAssetStyleProps
50
+ ) => {
51
+ setNativeAdAssetRegistrations((prev) => {
52
+ const current = prev[assetKey];
53
+
54
+ if (
55
+ current?.nativeTag === nativeTag &&
56
+ current?.styleProps === styleProps
57
+ ) {
58
+ return prev;
59
+ }
22
60
 
23
- const providerValue = React.useMemo(
61
+ return {
62
+ ...prev,
63
+ [assetKey]: {
64
+ nativeTag,
65
+ styleProps,
66
+ },
67
+ };
68
+ });
69
+ },
70
+ []
71
+ );
72
+
73
+ const unregisterNativeAdAsset = useCallback(
74
+ (assetKey: NativeAdViewAssetPropKey) => {
75
+ setNativeAdAssetRegistrations((prev) => {
76
+ if (!prev[assetKey]) return prev;
77
+
78
+ const next = { ...prev };
79
+ delete next[assetKey];
80
+ return next;
81
+ });
82
+ },
83
+ []
84
+ );
85
+
86
+ const providerValue = useMemo(
24
87
  () => ({
25
- nativeAdView,
26
- setNativeAdView,
88
+ nativeAdAssetRegistrations,
89
+ registerNativeAdAsset,
90
+ unregisterNativeAdAsset,
27
91
  }),
28
- [nativeAdView]
92
+ [nativeAdAssetRegistrations, registerNativeAdAsset, unregisterNativeAdAsset]
29
93
  );
30
94
 
31
- return <NativeAdViewContext.Provider value={providerValue}>{children}</NativeAdViewContext.Provider>;
95
+ return (
96
+ <NativeAdViewContext.Provider value={providerValue}>
97
+ {children}
98
+ </NativeAdViewContext.Provider>
99
+ );
32
100
  };
@@ -1,16 +1,16 @@
1
- import type { AdFormat } from "../AdBannerView";
2
- import type { AdProps } from "./AdProps";
1
+ import type { AdFormat } from '../AdBannerView';
2
+ import type { AdProps } from './AdProps';
3
3
 
4
4
  export type AdBannerViewHandler = {
5
- /**
6
- * If the {@link loadOnMount} attribute is set to false, you can call this API to start loading ads in this AdView.
7
- */
8
- loadAd(): void;
5
+ /**
6
+ * If the {@link loadOnMount} attribute is set to false, you can call this API to start loading ads in this AdView.
7
+ */
8
+ loadAd(): void;
9
9
  };
10
10
 
11
11
  export type AdBannerViewProps = AdProps & {
12
- color?: string;
13
- adFormat: AdFormat;
14
- loadOnMount?: boolean;
15
- isVisible?: boolean;
16
- }
12
+ color?: string;
13
+ adFormat: AdFormat;
14
+ loadOnMount?: boolean;
15
+ isVisible?: boolean;
16
+ };
@@ -2,36 +2,36 @@ import type { ErrorCode } from '../ErrorCode';
2
2
 
3
3
  // Represents an ad
4
4
  export type AdInfo = {
5
- // The ad unit ID for which this ad was loaded.
6
- adUnitId: string;
7
- // The total latency in milliseconds for this waterfall to finish processing.
8
- latencyMillis: number;
5
+ // The ad unit ID for which this ad was loaded.
6
+ adUnitId: string;
7
+ // The total latency in milliseconds for this waterfall to finish processing.
8
+ latencyMillis: number;
9
9
  };
10
10
 
11
11
  // Encapsulates various data for MAX load errors.
12
12
  export type AdLoadFailedInfo = {
13
- // The ad unit ID for which this ad was loaded.
14
- adUnitId: string;
13
+ // The ad unit ID for which this ad was loaded.
14
+ adUnitId: string;
15
15
 
16
- // The error code for the error.
17
- code: ErrorCode;
16
+ // The error code for the error.
17
+ code: ErrorCode;
18
18
 
19
- message: string;
19
+ message: string;
20
20
 
21
- // The total latency in milliseconds for this waterfall to finish processing.
22
- latencyMillis: number;
21
+ // The total latency in milliseconds for this waterfall to finish processing.
22
+ latencyMillis: number;
23
23
  };
24
24
 
25
25
  // Encapsulates various data for MAX display errors.
26
26
  export type AdDisplayFailedInfo = {
27
- message: string | null;
27
+ message: string | null;
28
28
  };
29
29
 
30
30
  // Represents a reward given to the user.
31
31
  export type AdRewardInfo = {
32
- // The reward label.
33
- rewardLabel?: string | null;
32
+ // The reward label.
33
+ rewardLabel?: string | null;
34
34
 
35
- // The rewarded amount.
36
- rewardAmount: string;
37
- };
35
+ // The rewarded amount.
36
+ rewardAmount: string;
37
+ };