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
@@ -0,0 +1,257 @@
1
+ package com.daro.reactnative
2
+
3
+ import android.app.Application
4
+ import android.content.Context
5
+ import com.daro.reactnative.constants.InternalDaroMBannerSize
6
+ import com.daro.reactnative.event.AppOpenEvent
7
+ import com.daro.reactnative.event.DaroMEvent
8
+ import com.daro.reactnative.event.InterstitialEvent
9
+ import com.daro.reactnative.event.LightPopupEvent
10
+ import com.daro.reactnative.event.RewardedEvent
11
+ import com.daro.reactnative.impl.DaroMBannerViewModuleImpl
12
+ import com.daro.reactnative.impl.DaroMInterstitialModuleImpl
13
+ import com.daro.reactnative.impl.DaroMLightPopupModuleImpl
14
+ import com.daro.reactnative.impl.DaroMRewardedAdModuleImpl
15
+ import com.daro.reactnative.util.EventEmitterUtil
16
+ import com.facebook.react.bridge.Promise
17
+ import com.facebook.react.bridge.ReactApplicationContext
18
+ import com.facebook.react.bridge.ReactContext
19
+ import com.facebook.react.bridge.ReactMethod
20
+ import com.facebook.react.bridge.ReadableMap
21
+ import com.facebook.react.bridge.WritableMap
22
+ import droom.daro.SDKConfig
23
+
24
+ class DaroMModule(reactContext: ReactApplicationContext) :
25
+ DaroMModuleSpec(reactContext) {
26
+
27
+ companion object {
28
+ const val NAME = "DaroMModule"
29
+ private const val APP_OPEN_UNSUPPORTED_CODE = "APP_OPEN_UNSUPPORTED"
30
+ private const val APP_OPEN_UNSUPPORTED_MESSAGE = "AppOpen ad is not supported on Android"
31
+ }
32
+
33
+ private val context: Context = reactApplicationContext
34
+
35
+ private var isInitialized: Boolean = false
36
+
37
+ @ReactMethod
38
+ override fun addListener(eventName: String) = Unit
39
+
40
+ @ReactMethod
41
+ override fun removeListeners(count: Double) = Unit
42
+
43
+ @ReactMethod
44
+ override fun initializeSdk(promise: Promise) {
45
+ DaroSdkBridge.initialize(
46
+ application = context.applicationContext as Application,
47
+ sdkConfig = SDKConfig.Builder()
48
+ .setDebugMode(false)
49
+ .build()
50
+ )
51
+
52
+ isInitialized = true
53
+ promise.resolve(null)
54
+ }
55
+
56
+ @ReactMethod
57
+ override fun isInitialized(promise: Promise) {
58
+ promise.resolve(isInitialized)
59
+ }
60
+
61
+ @ReactMethod
62
+ override fun showMediationDebugger(promise: Promise) {
63
+ DaroSdkBridge.openDebugger(context)
64
+ promise.resolve(null)
65
+ }
66
+
67
+ @ReactMethod
68
+ override fun setUserId(userId: String, promise: Promise) {
69
+ DaroSdkBridge.setUserId(context, userId)
70
+ promise.resolve(null)
71
+ }
72
+
73
+ protected override fun getTypedExportedConstants(): MutableMap<String, Any> {
74
+ val constants = mutableMapOf<String, Any>()
75
+ constants.putAll(daroMInterstitialModule.getComponents())
76
+ constants.putAll(daroMRewardedModule.getComponents())
77
+ constants.putAll(daroMLightPopupModule.getComponents())
78
+ constants.putAll(daroMAppOpenModule.getComponents())
79
+ constants.putAll(daroMBannerModule.getComponents())
80
+
81
+ return constants
82
+ }
83
+
84
+ internal abstract class DaroMComponentModule(protected val context: ReactContext) {
85
+ abstract fun getComponents(): MutableMap<String, Any>
86
+
87
+ fun sendNativeEvent(event: DaroMEvent, params: WritableMap?) {
88
+ EventEmitterUtil.sendReactNativeEvent(
89
+ reactContext = context,
90
+ event = event,
91
+ params = params,
92
+ )
93
+ }
94
+ }
95
+
96
+ @OptIn(ExperimentalStdlibApi::class)
97
+ internal abstract class DaroMInterstitialModule(context: ReactContext) :
98
+ DaroMComponentModule(context) {
99
+ abstract fun isInterstitialReady(requestId: Int, adUnitId: String, promise: Promise)
100
+ abstract fun loadInterstitial(requestId: Int, adUnitId: String)
101
+ abstract fun showInterstitial(requestId: Int, adUnitId: String)
102
+
103
+ override fun getComponents(): MutableMap<String, Any> {
104
+ return InterstitialEvent.entries.associate { it.value to it.value }.toMutableMap()
105
+ }
106
+ }
107
+
108
+ private val daroMInterstitialModule: DaroMInterstitialModule =
109
+ DaroMInterstitialModuleImpl(
110
+ context = reactContext,
111
+ getCurrentActivity = { reactApplicationContext.currentActivity }
112
+ )
113
+
114
+ @ReactMethod
115
+ override fun isInterstitialReady(requestId: Double, adUnitId: String, promise: Promise) {
116
+ daroMInterstitialModule.isInterstitialReady(requestId.toInt(), adUnitId, promise)
117
+ }
118
+
119
+ @ReactMethod
120
+ override fun loadInterstitial(requestId: Double, adUnitId: String, promise: Promise) {
121
+ daroMInterstitialModule.loadInterstitial(requestId.toInt(), adUnitId)
122
+ promise.resolve(null)
123
+ }
124
+
125
+ @ReactMethod
126
+ override fun showInterstitial(requestId: Double, adUnitId: String, promise: Promise) {
127
+ daroMInterstitialModule.showInterstitial(requestId.toInt(), adUnitId)
128
+ promise.resolve(null)
129
+ }
130
+
131
+ @OptIn(ExperimentalStdlibApi::class)
132
+ internal abstract class DaroMRewardedModule(context: ReactContext) :
133
+ DaroMComponentModule(context) {
134
+ abstract fun isRewardedAdReady(requestId: Int, adUnitId: String, promise: Promise)
135
+ abstract fun loadRewardedAd(requestId: Int, adUnitId: String)
136
+ abstract fun showRewardedAd(requestId: Int, adUnitId: String, customData: String?)
137
+
138
+ override fun getComponents(): MutableMap<String, Any> {
139
+ return RewardedEvent.entries.associate { it.value to it.value }.toMutableMap()
140
+ }
141
+ }
142
+
143
+ private val daroMRewardedModule: DaroMRewardedModule =
144
+ DaroMRewardedAdModuleImpl(
145
+ context = reactContext,
146
+ getCurrentActivity = { reactApplicationContext.currentActivity }
147
+ )
148
+
149
+ @ReactMethod
150
+ override fun isRewardedAdReady(requestId: Double, adUnitId: String, promise: Promise) {
151
+ daroMRewardedModule.isRewardedAdReady(requestId.toInt(), adUnitId, promise)
152
+ }
153
+
154
+ @ReactMethod
155
+ override fun loadRewardedAd(requestId: Double, adUnitId: String, promise: Promise) {
156
+ daroMRewardedModule.loadRewardedAd(requestId.toInt(), adUnitId)
157
+ promise.resolve(null)
158
+ }
159
+
160
+ @ReactMethod
161
+ override fun showRewardedAd(
162
+ requestId: Double,
163
+ adUnitId: String,
164
+ customData: String?,
165
+ promise: Promise,
166
+ ) {
167
+ daroMRewardedModule.showRewardedAd(requestId.toInt(), adUnitId, customData)
168
+ promise.resolve(null)
169
+ }
170
+
171
+ @OptIn(ExperimentalStdlibApi::class)
172
+ internal abstract class DaroMLightPopupModule(context: ReactContext) :
173
+ DaroMComponentModule(context) {
174
+ abstract fun isLightPopupReady(requestId: Int, adUnitId: String, promise: Promise)
175
+ abstract fun loadLightPopup(requestId: Int, adUnitId: String)
176
+ abstract fun showLightPopup(requestId: Int, adUnitId: String)
177
+
178
+ abstract fun setLightPopupAdConfiguration(requestId: Int, adUnitId: String, parameterMap: ReadableMap)
179
+
180
+ override fun getComponents(): MutableMap<String, Any> {
181
+ return LightPopupEvent.entries.associate { it.value to it.value }.toMutableMap()
182
+ }
183
+ }
184
+
185
+ private val daroMLightPopupModule: DaroMLightPopupModule = DaroMLightPopupModuleImpl(
186
+ context = reactContext,
187
+ getCurrentActivity = { reactApplicationContext.currentActivity }
188
+ )
189
+
190
+ @ReactMethod
191
+ override fun isLightPopupReady(requestId: Double, adUnitId: String, promise: Promise) {
192
+ daroMLightPopupModule.isLightPopupReady(requestId.toInt(), adUnitId, promise)
193
+ }
194
+
195
+ @ReactMethod
196
+ override fun loadLightPopup(requestId: Double, adUnitId: String, promise: Promise) {
197
+ daroMLightPopupModule.loadLightPopup(requestId.toInt(), adUnitId)
198
+ promise.resolve(null)
199
+ }
200
+
201
+ @ReactMethod
202
+ override fun showLightPopup(requestId: Double, adUnitId: String, promise: Promise) {
203
+ daroMLightPopupModule.showLightPopup(requestId.toInt(), adUnitId)
204
+ promise.resolve(null)
205
+ }
206
+
207
+ @ReactMethod
208
+ override fun setLightPopupAdConfiguration(
209
+ requestId: Double,
210
+ adUnitId: String,
211
+ configuration: ReadableMap,
212
+ promise: Promise,
213
+ ) {
214
+ daroMLightPopupModule.setLightPopupAdConfiguration(requestId.toInt(), adUnitId, configuration)
215
+ promise.resolve(null)
216
+ }
217
+
218
+ @OptIn(ExperimentalStdlibApi::class)
219
+ internal abstract class DaroMAppOpenModule(context: ReactContext) : DaroMComponentModule(context) {
220
+ override fun getComponents(): MutableMap<String, Any> {
221
+ return AppOpenEvent.entries.associate { it.value to it.value }.toMutableMap()
222
+ }
223
+ }
224
+
225
+ private val daroMAppOpenModule: DaroMAppOpenModule = object : DaroMAppOpenModule(reactContext) {}
226
+
227
+ @ReactMethod
228
+ override fun isAppOpenAdReady(requestId: Double, adUnitId: String, promise: Promise) {
229
+ promise.reject(APP_OPEN_UNSUPPORTED_CODE, APP_OPEN_UNSUPPORTED_MESSAGE)
230
+ }
231
+
232
+ @ReactMethod
233
+ override fun loadAppOpenAd(requestId: Double, adUnitId: String, promise: Promise) {
234
+ promise.reject(APP_OPEN_UNSUPPORTED_CODE, APP_OPEN_UNSUPPORTED_MESSAGE)
235
+ }
236
+
237
+ @ReactMethod
238
+ override fun showAppOpenAd(
239
+ requestId: Double,
240
+ adUnitId: String,
241
+ placement: String?,
242
+ customData: String?,
243
+ promise: Promise,
244
+ ) {
245
+ promise.reject(APP_OPEN_UNSUPPORTED_CODE, APP_OPEN_UNSUPPORTED_MESSAGE)
246
+ }
247
+
248
+ @OptIn(ExperimentalStdlibApi::class)
249
+ internal abstract class DaroMBannerModule(context: ReactContext) : DaroMComponentModule(context) {
250
+ override fun getComponents(): MutableMap<String, Any> {
251
+ return InternalDaroMBannerSize.entries.associate { it.key to it.name }.toMutableMap()
252
+ }
253
+ }
254
+
255
+ private val daroMBannerModule: DaroMBannerModule =
256
+ DaroMBannerViewModuleImpl(context = reactContext)
257
+ }
@@ -0,0 +1,45 @@
1
+ @file:Suppress("DEPRECATION")
2
+
3
+ package com.daro.reactnative
4
+
5
+ import com.facebook.react.TurboReactPackage
6
+ import com.facebook.react.bridge.NativeModule
7
+ import com.facebook.react.bridge.ReactApplicationContext
8
+ import com.facebook.react.module.model.ReactModuleInfo
9
+ import com.facebook.react.module.model.ReactModuleInfoProvider
10
+ import com.facebook.react.uimanager.ViewManager
11
+
12
+
13
+ class DaroMPackage : TurboReactPackage() {
14
+
15
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
16
+ return when (name) {
17
+ DaroMModule.NAME -> DaroMModule(reactContext)
18
+ else -> null
19
+ }
20
+ }
21
+
22
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
23
+ return listOf(
24
+ DaroMAdBannerViewManager(),
25
+ DaroMAdNativeViewManager(),
26
+ DaroMediaViewManager(),
27
+ )
28
+ }
29
+
30
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
31
+ return ReactModuleInfoProvider {
32
+ mapOf(
33
+ DaroMModule.NAME to ReactModuleInfo(
34
+ DaroMModule.NAME,
35
+ DaroMModule::class.java.name,
36
+ false,
37
+ false,
38
+ true,
39
+ false,
40
+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
41
+ )
42
+ )
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,25 @@
1
+ package com.daro.reactnative
2
+
3
+ import com.daro.reactnative.view.DaroMediaView
4
+ import com.facebook.react.uimanager.ThemedReactContext
5
+ import com.facebook.react.uimanager.ViewManagerDelegate
6
+ import com.facebook.react.uimanager.ViewGroupManager
7
+ import com.facebook.react.viewmanagers.DaroMediaViewManagerDelegate
8
+ import com.facebook.react.viewmanagers.DaroMediaViewManagerInterface
9
+
10
+ class DaroMediaViewManager : ViewGroupManager<DaroMediaView>(),
11
+ DaroMediaViewManagerInterface<DaroMediaView> {
12
+
13
+ private val delegate: ViewManagerDelegate<DaroMediaView> =
14
+ DaroMediaViewManagerDelegate(this)
15
+
16
+ override fun getDelegate(): ViewManagerDelegate<DaroMediaView> = delegate
17
+
18
+ override fun getName(): String {
19
+ return "DaroMediaView"
20
+ }
21
+
22
+ override fun createViewInstance(context: ThemedReactContext): DaroMediaView {
23
+ return DaroMediaView(context)
24
+ }
25
+ }
@@ -1,4 +1,4 @@
1
- package com.darom.constants
1
+ package com.daro.reactnative.constants
2
2
 
3
3
  import droom.daro.core.model.DaroBannerSize
4
4
 
@@ -1,4 +1,4 @@
1
- package com.darom.event
1
+ package com.daro.reactnative.event
2
2
 
3
3
  internal interface DaroMEvent{
4
4
  val value: String
@@ -44,14 +44,25 @@ internal enum class LightPopupEvent : DaroMEvent {
44
44
  get() = name
45
45
  }
46
46
 
47
- internal enum class AdViewEvent(
48
- val key: String
49
- ): DaroMEvent {
50
- ON_AD_CLICKED("onAdClickedEvent"),
51
- ON_AD_FAILED_TO_LOAD("onAdLoadFailedEvent"),
52
- ON_AD_IMPRESSION("onAdImpressionRecordedEvent"),
53
- ON_AD_LOADED("onAdLoadedEvent");
47
+ internal enum class AppOpenEvent : DaroMEvent {
48
+ ON_APPOPEN_AD_LOADED_EVENT,
49
+ ON_APPOPEN_AD_LOAD_FAILED_EVENT,
50
+ ON_APPOPEN_AD_CLICKED_EVENT,
51
+ ON_APPOPEN_AD_DISPLAYED_EVENT,
52
+ ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT,
53
+ ON_APPOPEN_AD_HIDDEN_EVENT,
54
+ ON_APPOPEN_AD_IMPRESSION_RECORDED;
54
55
 
55
56
  override val value: String
56
57
  get() = name
57
58
  }
59
+
60
+ internal enum class AdViewEvent(
61
+ val registrationName: String,
62
+ override val value: String,
63
+ ): DaroMEvent {
64
+ ON_AD_CLICKED("onAdClickedEvent", "topAdClickedEvent"),
65
+ ON_AD_FAILED_TO_LOAD("onAdLoadFailedEvent", "topAdLoadFailedEvent"),
66
+ ON_AD_IMPRESSION("onAdImpressionRecordedEvent", "topAdImpressionRecordedEvent"),
67
+ ON_AD_LOADED("onAdLoadedEvent", "topAdLoadedEvent");
68
+ }
@@ -1,6 +1,6 @@
1
- package com.darom.impl
1
+ package com.daro.reactnative.impl
2
2
 
3
- import com.darom.DaroMModule
3
+ import com.daro.reactnative.DaroMModule
4
4
  import com.facebook.react.bridge.ReactApplicationContext
5
5
 
6
6
  internal class DaroMBannerViewModuleImpl(
@@ -1,9 +1,9 @@
1
- package com.darom.impl
1
+ package com.daro.reactnative.impl
2
2
 
3
3
  import android.app.Activity
4
- import com.darom.DaroMModule
5
- import com.darom.event.InterstitialEvent
6
- import com.darom.util.AdInfoUtil
4
+ import com.daro.reactnative.DaroMModule
5
+ import com.daro.reactnative.event.InterstitialEvent
6
+ import com.daro.reactnative.util.AdInfoUtil
7
7
  import com.facebook.react.bridge.Promise
8
8
  import com.facebook.react.bridge.ReactApplicationContext
9
9
  import droom.daro.core.adunit.DaroInterstitialAdUnit
@@ -23,56 +23,56 @@ internal class DaroMInterstitialModuleImpl(
23
23
  private val currentActivity: Activity?
24
24
  get() = getCurrentActivity()
25
25
 
26
- private val loaderMap: MutableMap<String, DaroInterstitialAdLoader> = mutableMapOf()
27
- private val interstitialAdMap: MutableMap<String, DaroInterstitialAd> = mutableMapOf()
26
+ private val loaderMap: MutableMap<Int, DaroInterstitialAdLoader> = mutableMapOf()
27
+ private val interstitialAdMap: MutableMap<Int, DaroInterstitialAd> = mutableMapOf()
28
28
 
29
29
 
30
- override fun isInterstitialReady(adUnitId: String, promise: Promise) {
31
- promise.resolve(retrieveAd(adUnitId) != null)
30
+ override fun isInterstitialReady(requestId: Int, adUnitId: String, promise: Promise) {
31
+ promise.resolve(retrieveAd(requestId) != null)
32
32
  }
33
33
 
34
- override fun loadInterstitial(adUnitId: String) {
35
- retrieveLoader(adUnitId).load()
34
+ override fun loadInterstitial(requestId: Int, adUnitId: String) {
35
+ retrieveLoader(requestId, adUnitId).load()
36
36
  }
37
37
 
38
- override fun showInterstitial(adUnitId: String) {
38
+ override fun showInterstitial(requestId: Int, adUnitId: String) {
39
39
  currentActivity?.let {
40
- retrieveAd(adUnitId)?.apply {
40
+ retrieveAd(requestId)?.apply {
41
41
  setListener(object : DaroInterstitialAdListener {
42
42
  override fun onDismiss(ad: DaroAdInfo) {
43
43
  sendNativeEvent(
44
44
  event = InterstitialEvent.ON_INTERSTITIAL_HIDDEN_EVENT,
45
- params = AdInfoUtil.getAdInfo(adUnitId, ad),
45
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
46
46
  )
47
47
  }
48
48
 
49
49
  override fun onFailedToShow(ad: DaroAdInfo, error: DaroAdDisplayFailError) {
50
50
  sendNativeEvent(
51
51
  event = InterstitialEvent.ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT,
52
- params = AdInfoUtil.getAdDisplayFailedInfo(adUnitId, ad, error),
52
+ params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitId, ad, error),
53
53
  )
54
54
  }
55
55
 
56
56
  override fun onShown(ad: DaroAdInfo) {
57
57
  sendNativeEvent(
58
58
  event = InterstitialEvent.ON_INTERSTITIAL_DISPLAYED_EVENT,
59
- params = AdInfoUtil.getAdInfo(adUnitId, ad),
59
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
60
60
  )
61
61
 
62
- interstitialAdMap.remove(adUnitId)
62
+ interstitialAdMap.remove(requestId)
63
63
  }
64
64
 
65
65
  override fun onAdClicked(responseInfo: DaroAdInfo) {
66
66
  sendNativeEvent(
67
67
  event = InterstitialEvent.ON_INTERSTITIAL_CLICKED_EVENT,
68
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
68
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
69
69
  )
70
70
  }
71
71
 
72
72
  override fun onAdImpression(responseInfo: DaroAdInfo) {
73
73
  sendNativeEvent(
74
74
  event = InterstitialEvent.ON_INTERSTITIAL_AD_IMPRESSION_RECORDED,
75
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
75
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
76
76
  )
77
77
  }
78
78
  })
@@ -82,32 +82,32 @@ internal class DaroMInterstitialModuleImpl(
82
82
  }
83
83
  }
84
84
 
85
- private fun retrieveLoader(adUnitId: String): DaroInterstitialAdLoader {
86
- return loaderMap[adUnitId] ?: DaroInterstitialAdLoader(
85
+ private fun retrieveLoader(requestId: Int, adUnitId: String): DaroInterstitialAdLoader {
86
+ return loaderMap[requestId] ?: DaroInterstitialAdLoader(
87
87
  context,
88
88
  DaroInterstitialAdUnit(adUnitId, adUnitId)
89
89
  ).also {
90
- loaderMap[adUnitId] = it
90
+ loaderMap[requestId] = it
91
91
  it.setListener(object : DaroInterstitialAdLoaderListener {
92
92
  override fun onAdLoadSuccess(ad: DaroInterstitialAd, responseInfo: DaroAdInfo) {
93
- interstitialAdMap[adUnitId] = ad
93
+ interstitialAdMap[requestId] = ad
94
94
  sendNativeEvent(
95
95
  event = InterstitialEvent.ON_INTERSTITIAL_LOADED_EVENT,
96
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
96
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
97
97
  )
98
98
  }
99
99
 
100
100
  override fun onAdLoadFail(err: DaroAdLoadError) {
101
101
  sendNativeEvent(
102
102
  event = InterstitialEvent.ON_INTERSTITIAL_LOAD_FAILED_EVENT,
103
- params = AdInfoUtil.getAdLoadFailedInfo(adUnitId, err),
103
+ params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitId, err),
104
104
  )
105
105
  }
106
106
  })
107
107
  }
108
108
  }
109
109
 
110
- private fun retrieveAd(adUnitId: String): DaroInterstitialAd? {
111
- return interstitialAdMap[adUnitId]
110
+ private fun retrieveAd(requestId: Int): DaroInterstitialAd? {
111
+ return interstitialAdMap[requestId]
112
112
  }
113
113
  }
@@ -1,10 +1,10 @@
1
- package com.darom.impl
1
+ package com.daro.reactnative.impl
2
2
 
3
3
  import android.app.Activity
4
4
  import androidx.core.graphics.toColorInt
5
- import com.darom.DaroMModule
6
- import com.darom.event.LightPopupEvent
7
- import com.darom.util.AdInfoUtil
5
+ import com.daro.reactnative.DaroMModule
6
+ import com.daro.reactnative.event.LightPopupEvent
7
+ import com.daro.reactnative.util.AdInfoUtil
8
8
  import com.facebook.react.bridge.Promise
9
9
  import com.facebook.react.bridge.ReactApplicationContext
10
10
  import com.facebook.react.bridge.ReadableMap
@@ -26,21 +26,22 @@ internal class DaroMLightPopupModuleImpl(
26
26
  private val currentActivity: Activity?
27
27
  get() = getCurrentActivity()
28
28
 
29
- private val lightpopupAdMap: MutableMap<String, DaroLightPopupAd> = mutableMapOf()
30
- private val optionMap: MutableMap<String, DaroLightPopupAdOptions> = mutableMapOf()
31
- private val loaderMap: MutableMap<String, DaroLightPopupAdLoader> = mutableMapOf()
29
+ private val lightpopupAdMap: MutableMap<Int, DaroLightPopupAd> = mutableMapOf()
30
+ private val optionMap: MutableMap<Int, DaroLightPopupAdOptions> = mutableMapOf()
31
+ private val loaderMap: MutableMap<Int, DaroLightPopupAdLoader> = mutableMapOf()
32
32
 
33
- override fun isLightPopupReady(adUnitId: String, promise: Promise) {
34
- promise.resolve(retrieveAd(adUnitId) != null)
33
+ override fun isLightPopupReady(requestId: Int, adUnitId: String, promise: Promise) {
34
+ promise.resolve(retrieveAd(requestId) != null)
35
35
  }
36
36
 
37
- override fun loadLightPopup(adUnitId: String) {
37
+ override fun loadLightPopup(requestId: Int, adUnitId: String) {
38
38
  context.runOnUiQueueThread {
39
- retrieveLoader(adUnitId).load()
39
+ retrieveLoader(requestId, adUnitId).load()
40
40
  }
41
41
  }
42
42
 
43
43
  override fun setLightPopupAdConfiguration(
44
+ requestId: Int,
44
45
  adUnitId: String,
45
46
  parameterMap: ReadableMap,
46
47
  ) {
@@ -66,48 +67,48 @@ internal class DaroMLightPopupModuleImpl(
66
67
  )
67
68
  }
68
69
 
69
- optionMap[adUnitId] = newOption
70
+ optionMap[requestId] = newOption
70
71
  }
71
72
 
72
- override fun showLightPopup(adUnitId: String) {
73
+ override fun showLightPopup(requestId: Int, adUnitId: String) {
73
74
  currentActivity?.let {
74
75
  it.runOnUiThread {
75
- retrieveAd(adUnitId)?.apply {
76
+ retrieveAd(requestId)?.apply {
76
77
  setListener(object : DaroLightPopupAdListener {
77
78
  override fun onDismiss(ad: DaroAdInfo) {
78
79
  sendNativeEvent(
79
80
  event = LightPopupEvent.ON_LIGHTPOPUP_HIDDEN_EVENT,
80
- params = AdInfoUtil.getAdInfo(adUnitId, ad),
81
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
81
82
  )
82
83
  }
83
84
 
84
85
  override fun onFailedToShow(ad: DaroAdInfo, error: DaroAdDisplayFailError) {
85
86
  sendNativeEvent(
86
87
  event = LightPopupEvent.ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT,
87
- params = AdInfoUtil.getAdDisplayFailedInfo(adUnitId, ad, error),
88
+ params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitId, ad, error),
88
89
  )
89
90
  }
90
91
 
91
92
  override fun onShown(ad: DaroAdInfo) {
92
93
  sendNativeEvent(
93
94
  event = LightPopupEvent.ON_LIGHTPOPUP_DISPLAYED_EVENT,
94
- params = AdInfoUtil.getAdInfo(adUnitId, ad),
95
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
95
96
  )
96
97
 
97
- lightpopupAdMap.remove(adUnitId)
98
+ lightpopupAdMap.remove(requestId)
98
99
  }
99
100
 
100
101
  override fun onAdClicked(responseInfo: DaroAdInfo) {
101
102
  sendNativeEvent(
102
103
  event = LightPopupEvent.ON_LIGHTPOPUP_CLICKED_EVENT,
103
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
104
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
104
105
  )
105
106
  }
106
107
 
107
108
  override fun onAdImpression(responseInfo: DaroAdInfo) {
108
109
  sendNativeEvent(
109
110
  event = LightPopupEvent.ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
110
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
111
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
111
112
  )
112
113
  }
113
114
  })
@@ -118,32 +119,32 @@ internal class DaroMLightPopupModuleImpl(
118
119
  }
119
120
  }
120
121
 
121
- private fun retrieveLoader(adUnitId: String): DaroLightPopupAdLoader {
122
- return loaderMap[adUnitId] ?: DaroLightPopupAdLoader(
122
+ private fun retrieveLoader(requestId: Int, adUnitId: String): DaroLightPopupAdLoader {
123
+ return loaderMap[requestId] ?: DaroLightPopupAdLoader(
123
124
  context,
124
- DaroLightPopupAdUnit(adUnitId, adUnitId, optionMap[adUnitId] ?: DaroLightPopupAdOptions())
125
+ DaroLightPopupAdUnit(adUnitId, adUnitId, optionMap[requestId] ?: DaroLightPopupAdOptions())
125
126
  ).also {
126
- loaderMap[adUnitId] = it
127
+ loaderMap[requestId] = it
127
128
  it.setListener(object : DaroLightPopupAdLoaderListener {
128
129
  override fun onAdLoadSuccess(ad: DaroLightPopupAd, responseInfo: DaroAdInfo) {
129
- lightpopupAdMap[adUnitId] = ad
130
+ lightpopupAdMap[requestId] = ad
130
131
  sendNativeEvent(
131
132
  event = LightPopupEvent.ON_LIGHTPOPUP_LOADED_EVENT,
132
- params = AdInfoUtil.getAdInfo(adUnitId, responseInfo),
133
+ params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
133
134
  )
134
135
  }
135
136
 
136
137
  override fun onAdLoadFail(err: DaroAdLoadError) {
137
138
  sendNativeEvent(
138
139
  event = LightPopupEvent.ON_LIGHTPOPUP_LOAD_FAILED_EVENT,
139
- params = AdInfoUtil.getAdLoadFailedInfo(adUnitId, err),
140
+ params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitId, err),
140
141
  )
141
142
  }
142
143
  })
143
144
  }
144
145
  }
145
146
 
146
- private fun retrieveAd(adUnitId: String): DaroLightPopupAd? {
147
- return lightpopupAdMap[adUnitId]
147
+ private fun retrieveAd(requestId: Int): DaroLightPopupAd? {
148
+ return lightpopupAdMap[requestId]
148
149
  }
149
150
  }