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,9 +1,9 @@
1
- import { NativeModules } from 'react-native';
2
1
  import {
3
2
  addEventListener,
4
3
  removeEventListener,
5
4
  AdEventEmitter,
6
5
  } from './EventEmitter';
6
+ import NativeDaroModule from './NativeDaroModule';
7
7
  import type {
8
8
  AdDisplayFailedInfo,
9
9
  AdInfo,
@@ -11,8 +11,6 @@ import type {
11
11
  } from './types/AdInfo';
12
12
  import { AdEventType, type AdEventPayloadMap } from './types/AdEvent';
13
13
 
14
- const { DaroMModule } = NativeModules;
15
-
16
14
  const {
17
15
  ON_INTERSTITIAL_LOADED_EVENT,
18
16
  ON_INTERSTITIAL_LOAD_FAILED_EVENT,
@@ -21,7 +19,7 @@ const {
21
19
  ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT,
22
20
  ON_INTERSTITIAL_HIDDEN_EVENT,
23
21
  ON_INTERSTITIAL_AD_IMPRESSION_RECORDED,
24
- } = DaroMModule.getConstants();
22
+ } = NativeDaroModule.getConstants();
25
23
 
26
24
  const NATIVE_EVENT_BY_TYPE: Record<AdEventType, string> = {
27
25
  [AdEventType.LOADED]: ON_INTERSTITIAL_LOADED_EVENT,
@@ -34,24 +32,32 @@ const NATIVE_EVENT_BY_TYPE: Record<AdEventType, string> = {
34
32
  };
35
33
 
36
34
  export class InterstitialAd {
35
+ private static _nextRequestId = 1;
36
+ private static _legacyRequestIds = new Map<string, number>();
37
+ private static _legacyRequestIdSet = new Set<number>();
38
+
37
39
  private readonly eventEmitter = new AdEventEmitter();
38
40
 
39
- private constructor(private readonly adUnitId: string) {}
41
+ private constructor(
42
+ private readonly requestId: number,
43
+ private readonly adUnitId: string
44
+ ) {}
40
45
 
41
46
  static createForAdRequest(adUnitId: string): InterstitialAd {
42
- return new InterstitialAd(adUnitId);
47
+ const requestId = InterstitialAd._nextRequestId++;
48
+ return new InterstitialAd(requestId, adUnitId);
43
49
  }
44
50
 
45
51
  isAdReady(): Promise<boolean> {
46
- return DaroMModule.isInterstitialReady(this.adUnitId);
52
+ return NativeDaroModule.isInterstitialReady(this.requestId, this.adUnitId);
47
53
  }
48
54
 
49
55
  load(): void {
50
- DaroMModule.loadInterstitial(this.adUnitId);
56
+ NativeDaroModule.loadInterstitial(this.requestId, this.adUnitId);
51
57
  }
52
58
 
53
59
  show(): void {
54
- DaroMModule.showInterstitial(this.adUnitId);
60
+ NativeDaroModule.showInterstitial(this.requestId, this.adUnitId);
55
61
  }
56
62
 
57
63
  addAdEventListener<T extends AdEventType>(
@@ -59,9 +65,9 @@ export class InterstitialAd {
59
65
  listener: (info: AdEventPayloadMap[T]) => void
60
66
  ): () => void {
61
67
  const nativeEvent = NATIVE_EVENT_BY_TYPE[type];
62
- const adUnitId = this.adUnitId;
68
+ const requestId = this.requestId;
63
69
  return this.eventEmitter.addEventListener(nativeEvent, (payload: any) => {
64
- if (payload?.adUnitId !== undefined && payload.adUnitId !== adUnitId) {
70
+ if (payload?.requestId !== requestId) {
65
71
  return;
66
72
  }
67
73
  listener(payload);
@@ -73,25 +79,55 @@ export class InterstitialAd {
73
79
  }
74
80
 
75
81
  // ---- Deprecated static API (backward compatibility) ----
82
+ // Static API allocates a stable requestId per adUnitId and reuses it.
83
+ // Multiple static calls for the same adUnitId share the same native slot.
84
+
85
+ private static _getLegacyRequestId(adUnitId: string): number {
86
+ let requestId = InterstitialAd._legacyRequestIds.get(adUnitId);
87
+ if (requestId === undefined) {
88
+ requestId = InterstitialAd._nextRequestId++;
89
+ InterstitialAd._legacyRequestIds.set(adUnitId, requestId);
90
+ InterstitialAd._legacyRequestIdSet.add(requestId);
91
+ }
92
+ return requestId;
93
+ }
94
+
95
+ private static _addLegacyEventListener<T>(
96
+ event: string,
97
+ listener: (info: T) => void
98
+ ): void {
99
+ addEventListener(event, (payload: any) => {
100
+ if (!InterstitialAd._legacyRequestIdSet.has(payload?.requestId)) {
101
+ return;
102
+ }
103
+ listener(payload);
104
+ });
105
+ }
76
106
 
77
107
  /** @deprecated `InterstitialAd.createForAdRequest(adUnitId)` 인스턴스의 `isAdReady()`를 사용하세요. */
78
108
  static isAdReady(adUnitId: string): Promise<boolean> {
79
- return DaroMModule.isInterstitialReady(adUnitId);
109
+ const requestId = InterstitialAd._getLegacyRequestId(adUnitId);
110
+ return NativeDaroModule.isInterstitialReady(requestId, adUnitId);
80
111
  }
81
112
 
82
113
  /** @deprecated `InterstitialAd.createForAdRequest(adUnitId)` 인스턴스의 `load()`를 사용하세요. */
83
114
  static loadAd(adUnitId: string): void {
84
- DaroMModule.loadInterstitial(adUnitId);
115
+ const requestId = InterstitialAd._getLegacyRequestId(adUnitId);
116
+ NativeDaroModule.loadInterstitial(requestId, adUnitId);
85
117
  }
86
118
 
87
119
  /** @deprecated `InterstitialAd.createForAdRequest(adUnitId)` 인스턴스의 `show()`를 사용하세요. */
88
120
  static showAd(adUnitId: string): void {
89
- DaroMModule.showInterstitial(adUnitId);
121
+ const requestId = InterstitialAd._getLegacyRequestId(adUnitId);
122
+ NativeDaroModule.showInterstitial(requestId, adUnitId);
90
123
  }
91
124
 
92
125
  /** @deprecated `addAdEventListener(AdEventType.LOADED, ...)`를 인스턴스에서 사용하세요. */
93
126
  static addAdLoadedEventListener(listener: (adInfo: AdInfo) => void): void {
94
- addEventListener(ON_INTERSTITIAL_LOADED_EVENT, listener);
127
+ InterstitialAd._addLegacyEventListener(
128
+ ON_INTERSTITIAL_LOADED_EVENT,
129
+ listener
130
+ );
95
131
  }
96
132
 
97
133
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -103,7 +139,10 @@ export class InterstitialAd {
103
139
  static addAdLoadFailedEventListener(
104
140
  listener: (errorInfo: AdLoadFailedInfo) => void
105
141
  ): void {
106
- addEventListener(ON_INTERSTITIAL_LOAD_FAILED_EVENT, listener);
142
+ InterstitialAd._addLegacyEventListener(
143
+ ON_INTERSTITIAL_LOAD_FAILED_EVENT,
144
+ listener
145
+ );
107
146
  }
108
147
 
109
148
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -113,7 +152,10 @@ export class InterstitialAd {
113
152
 
114
153
  /** @deprecated `addAdEventListener(AdEventType.CLICKED, ...)`를 인스턴스에서 사용하세요. */
115
154
  static addAdClickedEventListener(listener: (adInfo: AdInfo) => void): void {
116
- addEventListener(ON_INTERSTITIAL_CLICKED_EVENT, listener);
155
+ InterstitialAd._addLegacyEventListener(
156
+ ON_INTERSTITIAL_CLICKED_EVENT,
157
+ listener
158
+ );
117
159
  }
118
160
 
119
161
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -123,7 +165,10 @@ export class InterstitialAd {
123
165
 
124
166
  /** @deprecated `addAdEventListener(AdEventType.DISPLAYED, ...)`를 인스턴스에서 사용하세요. */
125
167
  static addAdDisplayedEventListener(listener: (adInfo: AdInfo) => void): void {
126
- addEventListener(ON_INTERSTITIAL_DISPLAYED_EVENT, listener);
168
+ InterstitialAd._addLegacyEventListener(
169
+ ON_INTERSTITIAL_DISPLAYED_EVENT,
170
+ listener
171
+ );
127
172
  }
128
173
 
129
174
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -135,7 +180,10 @@ export class InterstitialAd {
135
180
  static addAdFailedToDisplayEventListener(
136
181
  listener: (errorInfo: AdDisplayFailedInfo) => void
137
182
  ): void {
138
- addEventListener(ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT, listener);
183
+ InterstitialAd._addLegacyEventListener(
184
+ ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT,
185
+ listener
186
+ );
139
187
  }
140
188
 
141
189
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -145,7 +193,10 @@ export class InterstitialAd {
145
193
 
146
194
  /** @deprecated `addAdEventListener(AdEventType.HIDDEN, ...)`를 인스턴스에서 사용하세요. */
147
195
  static addAdHiddenEventListener(listener: (adInfo: AdInfo) => void): void {
148
- addEventListener(ON_INTERSTITIAL_HIDDEN_EVENT, listener);
196
+ InterstitialAd._addLegacyEventListener(
197
+ ON_INTERSTITIAL_HIDDEN_EVENT,
198
+ listener
199
+ );
149
200
  }
150
201
 
151
202
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -157,7 +208,10 @@ export class InterstitialAd {
157
208
  static addAdImpressionRecordedListener(
158
209
  listener: (adInfo: AdInfo) => void
159
210
  ): void {
160
- addEventListener(ON_INTERSTITIAL_AD_IMPRESSION_RECORDED, listener);
211
+ InterstitialAd._addLegacyEventListener(
212
+ ON_INTERSTITIAL_AD_IMPRESSION_RECORDED,
213
+ listener
214
+ );
161
215
  }
162
216
 
163
217
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -1,9 +1,10 @@
1
- import { NativeModules } from 'react-native';
1
+ import { processColor, type ColorValue } from 'react-native';
2
2
  import {
3
3
  addEventListener,
4
4
  removeEventListener,
5
5
  AdEventEmitter,
6
6
  } from './EventEmitter';
7
+ import NativeDaroModule from './NativeDaroModule';
7
8
  import type {
8
9
  AdDisplayFailedInfo,
9
10
  AdInfo,
@@ -11,9 +12,6 @@ import type {
11
12
  } from './types/AdInfo';
12
13
  import type { LightPopupAdConfiguration } from './types/LightPopupAd';
13
14
  import { AdEventType, type AdEventPayloadMap } from './types/AdEvent';
14
- import tinycolor from 'tinycolor2';
15
-
16
- const { DaroMModule } = NativeModules;
17
15
 
18
16
  const {
19
17
  ON_LIGHTPOPUP_LOADED_EVENT,
@@ -23,7 +21,7 @@ const {
23
21
  ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT,
24
22
  ON_LIGHTPOPUP_HIDDEN_EVENT,
25
23
  ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
26
- } = DaroMModule.getConstants();
24
+ } = NativeDaroModule.getConstants();
27
25
 
28
26
  const NATIVE_EVENT_BY_TYPE: Record<AdEventType, string> = {
29
27
  [AdEventType.LOADED]: ON_LIGHTPOPUP_LOADED_EVENT,
@@ -35,35 +33,28 @@ const NATIVE_EVENT_BY_TYPE: Record<AdEventType, string> = {
35
33
  [AdEventType.IMPRESSION_RECORDED]: ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
36
34
  };
37
35
 
38
- function colorToHex(color: any): string | undefined {
39
- if (typeof color === 'number') {
40
- // react-native에서 number로 오는 경우 (ex: processColor)
41
- // #AARRGGBB로 변환
42
- return `#${color.toString(16).padStart(8, '0')}`.toUpperCase();
43
- }
44
- if (typeof color === 'string') {
45
- const tc = tinycolor(color);
46
- if (tc.isValid()) {
47
- // alpha가 1이면 #RRGGBB, 아니면 #AARRGGBB
48
- const hex = tc.toHexString().toUpperCase();
49
- const alpha = Math.round(tc.getAlpha() * 255);
50
- if (alpha === 255) {
51
- return hex;
52
- } else {
53
- return (
54
- '#' +
55
- alpha.toString(16).padStart(2, '0').toUpperCase() +
56
- tc.toHex().toUpperCase()
57
- );
58
- }
59
- }
36
+ const colorToHex = (color: ColorValue | undefined): string | undefined => {
37
+ if (color === undefined || color === null) {
38
+ return undefined;
60
39
  }
61
- return undefined;
62
- }
63
40
 
64
- function normalizeConfiguration(
41
+ const processedColor = processColor(color);
42
+ if (typeof processedColor !== 'number') {
43
+ return undefined;
44
+ }
45
+
46
+ const argb = processedColor >>> 0;
47
+ const alpha = (argb >>> 24) & 0xff;
48
+ if (alpha === 0xff) {
49
+ return `#${(argb & 0x00ffffff).toString(16).padStart(6, '0')}`.toUpperCase();
50
+ }
51
+
52
+ return `#${argb.toString(16).padStart(8, '0')}`.toUpperCase();
53
+ };
54
+
55
+ const normalizeConfiguration = (
65
56
  configuration: LightPopupAdConfiguration
66
- ): LightPopupAdConfiguration {
57
+ ): LightPopupAdConfiguration => {
67
58
  const config = { ...configuration };
68
59
 
69
60
  if (config.backgroundColor)
@@ -91,31 +82,40 @@ function normalizeConfiguration(
91
82
  );
92
83
 
93
84
  return config;
94
- }
85
+ };
95
86
 
96
87
  export class LightPopupAd {
88
+ private static _nextRequestId = 1;
89
+ private static _legacyRequestIds = new Map<string, number>();
90
+ private static _legacyRequestIdSet = new Set<number>();
91
+
97
92
  private readonly eventEmitter = new AdEventEmitter();
98
93
 
99
- private constructor(private readonly adUnitId: string) {}
94
+ private constructor(
95
+ private readonly requestId: number,
96
+ private readonly adUnitId: string
97
+ ) {}
100
98
 
101
99
  static createForAdRequest(adUnitId: string): LightPopupAd {
102
- return new LightPopupAd(adUnitId);
100
+ const requestId = LightPopupAd._nextRequestId++;
101
+ return new LightPopupAd(requestId, adUnitId);
103
102
  }
104
103
 
105
104
  isAdReady(): Promise<boolean> {
106
- return DaroMModule.isLightPopupReady(this.adUnitId);
105
+ return NativeDaroModule.isLightPopupReady(this.requestId, this.adUnitId);
107
106
  }
108
107
 
109
108
  load(): void {
110
- DaroMModule.loadLightPopup(this.adUnitId);
109
+ NativeDaroModule.loadLightPopup(this.requestId, this.adUnitId);
111
110
  }
112
111
 
113
112
  show(): void {
114
- DaroMModule.showLightPopup(this.adUnitId);
113
+ NativeDaroModule.showLightPopup(this.requestId, this.adUnitId);
115
114
  }
116
115
 
117
116
  setConfiguration(configuration: LightPopupAdConfiguration): void {
118
- DaroMModule.setLightPopupAdConfiguration(
117
+ NativeDaroModule.setLightPopupAdConfiguration(
118
+ this.requestId,
119
119
  this.adUnitId,
120
120
  normalizeConfiguration(configuration)
121
121
  );
@@ -126,9 +126,9 @@ export class LightPopupAd {
126
126
  listener: (info: AdEventPayloadMap[T]) => void
127
127
  ): () => void {
128
128
  const nativeEvent = NATIVE_EVENT_BY_TYPE[type];
129
- const adUnitId = this.adUnitId;
129
+ const requestId = this.requestId;
130
130
  return this.eventEmitter.addEventListener(nativeEvent, (payload: any) => {
131
- if (payload?.adUnitId !== undefined && payload.adUnitId !== adUnitId) {
131
+ if (payload?.requestId !== requestId) {
132
132
  return;
133
133
  }
134
134
  listener(payload);
@@ -141,19 +141,44 @@ export class LightPopupAd {
141
141
 
142
142
  // ---- Deprecated static API (backward compatibility) ----
143
143
 
144
+ private static _getLegacyRequestId(adUnitId: string): number {
145
+ let requestId = LightPopupAd._legacyRequestIds.get(adUnitId);
146
+ if (requestId === undefined) {
147
+ requestId = LightPopupAd._nextRequestId++;
148
+ LightPopupAd._legacyRequestIds.set(adUnitId, requestId);
149
+ LightPopupAd._legacyRequestIdSet.add(requestId);
150
+ }
151
+ return requestId;
152
+ }
153
+
154
+ private static _addLegacyEventListener<T>(
155
+ event: string,
156
+ listener: (info: T) => void
157
+ ): void {
158
+ addEventListener(event, (payload: any) => {
159
+ if (!LightPopupAd._legacyRequestIdSet.has(payload?.requestId)) {
160
+ return;
161
+ }
162
+ listener(payload);
163
+ });
164
+ }
165
+
144
166
  /** @deprecated `LightPopupAd.createForAdRequest(adUnitId)` 인스턴스의 `isAdReady()`를 사용하세요. */
145
167
  static isAdReady(adUnitId: string): Promise<boolean> {
146
- return DaroMModule.isLightPopupReady(adUnitId);
168
+ const requestId = LightPopupAd._getLegacyRequestId(adUnitId);
169
+ return NativeDaroModule.isLightPopupReady(requestId, adUnitId);
147
170
  }
148
171
 
149
172
  /** @deprecated `LightPopupAd.createForAdRequest(adUnitId)` 인스턴스의 `load()`를 사용하세요. */
150
173
  static loadAd(adUnitId: string): void {
151
- DaroMModule.loadLightPopup(adUnitId);
174
+ const requestId = LightPopupAd._getLegacyRequestId(adUnitId);
175
+ NativeDaroModule.loadLightPopup(requestId, adUnitId);
152
176
  }
153
177
 
154
178
  /** @deprecated `LightPopupAd.createForAdRequest(adUnitId)` 인스턴스의 `show()`를 사용하세요. */
155
179
  static showAd(adUnitId: string): void {
156
- DaroMModule.showLightPopup(adUnitId);
180
+ const requestId = LightPopupAd._getLegacyRequestId(adUnitId);
181
+ NativeDaroModule.showLightPopup(requestId, adUnitId);
157
182
  }
158
183
 
159
184
  /** @deprecated 인스턴스의 `setConfiguration()`을 사용하세요. */
@@ -161,7 +186,9 @@ export class LightPopupAd {
161
186
  adUnitId: string,
162
187
  configuration: LightPopupAdConfiguration
163
188
  ): void {
164
- DaroMModule.setLightPopupAdConfiguration(
189
+ const requestId = LightPopupAd._getLegacyRequestId(adUnitId);
190
+ NativeDaroModule.setLightPopupAdConfiguration(
191
+ requestId,
165
192
  adUnitId,
166
193
  normalizeConfiguration(configuration)
167
194
  );
@@ -169,7 +196,7 @@ export class LightPopupAd {
169
196
 
170
197
  /** @deprecated `addAdEventListener(AdEventType.LOADED, ...)`를 인스턴스에서 사용하세요. */
171
198
  static addAdLoadedEventListener(listener: (adInfo: AdInfo) => void): void {
172
- addEventListener(ON_LIGHTPOPUP_LOADED_EVENT, listener);
199
+ LightPopupAd._addLegacyEventListener(ON_LIGHTPOPUP_LOADED_EVENT, listener);
173
200
  }
174
201
 
175
202
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -181,7 +208,10 @@ export class LightPopupAd {
181
208
  static addAdLoadFailedEventListener(
182
209
  listener: (errorInfo: AdLoadFailedInfo) => void
183
210
  ): void {
184
- addEventListener(ON_LIGHTPOPUP_LOAD_FAILED_EVENT, listener);
211
+ LightPopupAd._addLegacyEventListener(
212
+ ON_LIGHTPOPUP_LOAD_FAILED_EVENT,
213
+ listener
214
+ );
185
215
  }
186
216
 
187
217
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -191,7 +221,7 @@ export class LightPopupAd {
191
221
 
192
222
  /** @deprecated `addAdEventListener(AdEventType.CLICKED, ...)`를 인스턴스에서 사용하세요. */
193
223
  static addAdClickedEventListener(listener: (adInfo: AdInfo) => void): void {
194
- addEventListener(ON_LIGHTPOPUP_CLICKED_EVENT, listener);
224
+ LightPopupAd._addLegacyEventListener(ON_LIGHTPOPUP_CLICKED_EVENT, listener);
195
225
  }
196
226
 
197
227
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -201,7 +231,10 @@ export class LightPopupAd {
201
231
 
202
232
  /** @deprecated `addAdEventListener(AdEventType.DISPLAYED, ...)`를 인스턴스에서 사용하세요. */
203
233
  static addAdDisplayedEventListener(listener: (adInfo: AdInfo) => void): void {
204
- addEventListener(ON_LIGHTPOPUP_DISPLAYED_EVENT, listener);
234
+ LightPopupAd._addLegacyEventListener(
235
+ ON_LIGHTPOPUP_DISPLAYED_EVENT,
236
+ listener
237
+ );
205
238
  }
206
239
 
207
240
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -213,7 +246,10 @@ export class LightPopupAd {
213
246
  static addAdFailedToDisplayEventListener(
214
247
  listener: (errorInfo: AdDisplayFailedInfo) => void
215
248
  ): void {
216
- addEventListener(ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT, listener);
249
+ LightPopupAd._addLegacyEventListener(
250
+ ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT,
251
+ listener
252
+ );
217
253
  }
218
254
 
219
255
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -223,7 +259,7 @@ export class LightPopupAd {
223
259
 
224
260
  /** @deprecated `addAdEventListener(AdEventType.HIDDEN, ...)`를 인스턴스에서 사용하세요. */
225
261
  static addAdHiddenEventListener(listener: (adInfo: AdInfo) => void): void {
226
- addEventListener(ON_LIGHTPOPUP_HIDDEN_EVENT, listener);
262
+ LightPopupAd._addLegacyEventListener(ON_LIGHTPOPUP_HIDDEN_EVENT, listener);
227
263
  }
228
264
 
229
265
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -235,7 +271,10 @@ export class LightPopupAd {
235
271
  static addAdImpressionRecordedListener(
236
272
  listener: (adInfo: AdInfo) => void
237
273
  ): void {
238
- addEventListener(ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED, listener);
274
+ LightPopupAd._addLegacyEventListener(
275
+ ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
276
+ listener
277
+ );
239
278
  }
240
279
 
241
280
  /** @deprecated 인스턴스의 `addAdEventListener` disposer를 사용하세요. */
@@ -0,0 +1,91 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+ import type {
4
+ Double,
5
+ UnsafeObject,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
7
+
8
+ export type DaroModuleConstants = {
9
+ ON_INTERSTITIAL_LOADED_EVENT: string;
10
+ ON_INTERSTITIAL_LOAD_FAILED_EVENT: string;
11
+ ON_INTERSTITIAL_CLICKED_EVENT: string;
12
+ ON_INTERSTITIAL_DISPLAYED_EVENT: string;
13
+ ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT: string;
14
+ ON_INTERSTITIAL_HIDDEN_EVENT: string;
15
+ ON_INTERSTITIAL_AD_IMPRESSION_RECORDED: string;
16
+
17
+ ON_REWARDED_AD_LOADED_EVENT: string;
18
+ ON_REWARDED_AD_LOAD_FAILED_EVENT: string;
19
+ ON_REWARDED_AD_CLICKED_EVENT: string;
20
+ ON_REWARDED_AD_DISPLAYED_EVENT: string;
21
+ ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT: string;
22
+ ON_REWARDED_AD_HIDDEN_EVENT: string;
23
+ ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
24
+ ON_REWARDED_AD_IMPRESSION_RECORDED: string;
25
+
26
+ ON_APPOPEN_AD_LOADED_EVENT: string;
27
+ ON_APPOPEN_AD_LOAD_FAILED_EVENT: string;
28
+ ON_APPOPEN_AD_CLICKED_EVENT: string;
29
+ ON_APPOPEN_AD_DISPLAYED_EVENT: string;
30
+ ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT: string;
31
+ ON_APPOPEN_AD_HIDDEN_EVENT: string;
32
+ ON_APPOPEN_AD_IMPRESSION_RECORDED: string;
33
+
34
+ ON_LIGHTPOPUP_LOADED_EVENT: string;
35
+ ON_LIGHTPOPUP_LOAD_FAILED_EVENT: string;
36
+ ON_LIGHTPOPUP_CLICKED_EVENT: string;
37
+ ON_LIGHTPOPUP_DISPLAYED_EVENT: string;
38
+ ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT: string;
39
+ ON_LIGHTPOPUP_HIDDEN_EVENT: string;
40
+ ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED: string;
41
+
42
+ BANNER_AD_FORMAT_LABEL: string;
43
+ MREC_AD_FORMAT_LABEL: string;
44
+ UNKNOWN_AD_FORMAT_LABEL?: string;
45
+ };
46
+
47
+ export interface Spec extends TurboModule {
48
+ getConstants: () => DaroModuleConstants;
49
+ addListener: (eventName: string) => void;
50
+ removeListeners: (count: number) => void;
51
+
52
+ isInitialized: () => Promise<boolean>;
53
+ initializeSdk: () => Promise<void>;
54
+ setUserId: (userId: string) => Promise<void>;
55
+ showMediationDebugger: () => Promise<void>;
56
+
57
+ isInterstitialReady: (
58
+ requestId: Double,
59
+ adUnitId: string
60
+ ) => Promise<boolean>;
61
+ loadInterstitial: (requestId: Double, adUnitId: string) => Promise<void>;
62
+ showInterstitial: (requestId: Double, adUnitId: string) => Promise<void>;
63
+
64
+ isRewardedAdReady: (requestId: Double, adUnitId: string) => Promise<boolean>;
65
+ loadRewardedAd: (requestId: Double, adUnitId: string) => Promise<void>;
66
+ showRewardedAd: (
67
+ requestId: Double,
68
+ adUnitId: string,
69
+ customData?: string | null
70
+ ) => Promise<void>;
71
+
72
+ isAppOpenAdReady: (requestId: Double, adUnitId: string) => Promise<boolean>;
73
+ loadAppOpenAd: (requestId: Double, adUnitId: string) => Promise<void>;
74
+ showAppOpenAd: (
75
+ requestId: Double,
76
+ adUnitId: string,
77
+ placement?: string | null,
78
+ customData?: string | null
79
+ ) => Promise<void>;
80
+
81
+ isLightPopupReady: (requestId: Double, adUnitId: string) => Promise<boolean>;
82
+ loadLightPopup: (requestId: Double, adUnitId: string) => Promise<void>;
83
+ showLightPopup: (requestId: Double, adUnitId: string) => Promise<void>;
84
+ setLightPopupAdConfiguration: (
85
+ requestId: Double,
86
+ adUnitId: string,
87
+ configuration: UnsafeObject
88
+ ) => Promise<void>;
89
+ }
90
+
91
+ export default TurboModuleRegistry.getEnforcing<Spec>('DaroMModule');