react-native-daro 2.0.7 → 2.0.8

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 (129) hide show
  1. package/README.md +2 -2
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/daro/reactnative/DaroRNAdBannerViewManager.kt +3 -3
  4. package/android/src/main/java/com/daro/reactnative/DaroRNAdNativeViewManager.kt +3 -3
  5. package/android/src/main/java/com/daro/reactnative/DaroRNModule.kt +34 -34
  6. package/android/src/main/java/com/daro/reactnative/impl/DaroRNInterstitialModuleImpl.kt +13 -13
  7. package/android/src/main/java/com/daro/reactnative/impl/DaroRNLightPopupModuleImpl.kt +12 -12
  8. package/android/src/main/java/com/daro/reactnative/impl/DaroRNRewardedAdModuleImpl.kt +14 -14
  9. package/android/src/main/java/com/daro/reactnative/util/AdInfoUtil.kt +16 -16
  10. package/android/src/main/java/com/daro/reactnative/view/DaroRNAdBannerViewContainer.kt +8 -8
  11. package/android/src/main/java/com/daro/reactnative/view/DaroRNAdNativeViewContainer.kt +8 -8
  12. package/android/src/oldarch/java/com/daro/reactnative/DaroRNModuleSpec.kt +14 -14
  13. package/ios/DaroRNModule+AppOpen.swift +9 -9
  14. package/ios/DaroRNModule+Interstitial.swift +9 -9
  15. package/ios/DaroRNModule+LightPopup.swift +13 -13
  16. package/ios/DaroRNModule+Rewarded.swift +14 -14
  17. package/ios/DaroRNModule.mm +14 -14
  18. package/ios/DaroRNModule.swift +1 -1
  19. package/ios/Fabric/DaroRNAdBannerComponentView.mm +7 -7
  20. package/ios/Fabric/DaroRNNativeAdComponentView.mm +7 -7
  21. package/ios/Paper/DaroRNAdBannerViewManager.m +1 -1
  22. package/ios/Paper/DaroRNNativeAdViewManager.m +1 -1
  23. package/ios/Shared/DaroRNBannerAdView.swift +8 -8
  24. package/ios/Shared/DaroRNNativeAdView.swift +14 -14
  25. package/lib/commonjs/AdBannerView.js +2 -2
  26. package/lib/commonjs/AdBannerView.js.map +1 -1
  27. package/lib/commonjs/AppOpenAd.js +22 -22
  28. package/lib/commonjs/AppOpenAd.js.map +1 -1
  29. package/lib/commonjs/DaroRNAdBannerViewNativeComponent.ts +3 -3
  30. package/lib/commonjs/DaroRNNativeAdViewNativeComponent.ts +3 -3
  31. package/lib/commonjs/InterstitialAd.js +24 -24
  32. package/lib/commonjs/InterstitialAd.js.map +1 -1
  33. package/lib/commonjs/LightPopupAd.js +27 -27
  34. package/lib/commonjs/LightPopupAd.js.map +1 -1
  35. package/lib/commonjs/RewardedAd.js +22 -22
  36. package/lib/commonjs/RewardedAd.js.map +1 -1
  37. package/lib/commonjs/hooks/useInterstitialAd.js +6 -6
  38. package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -1
  39. package/lib/commonjs/hooks/useLightPopupAd.js +5 -5
  40. package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -1
  41. package/lib/commonjs/hooks/useRewardedAd.js +6 -6
  42. package/lib/commonjs/hooks/useRewardedAd.js.map +1 -1
  43. package/lib/commonjs/nativeAd/NativeAdView.js +2 -2
  44. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  45. package/lib/module/AdBannerView.js +2 -2
  46. package/lib/module/AdBannerView.js.map +1 -1
  47. package/lib/module/AppOpenAd.js +22 -22
  48. package/lib/module/AppOpenAd.js.map +1 -1
  49. package/lib/module/DaroRNAdBannerViewNativeComponent.ts +3 -3
  50. package/lib/module/DaroRNNativeAdViewNativeComponent.ts +3 -3
  51. package/lib/module/InterstitialAd.js +24 -24
  52. package/lib/module/InterstitialAd.js.map +1 -1
  53. package/lib/module/LightPopupAd.js +27 -27
  54. package/lib/module/LightPopupAd.js.map +1 -1
  55. package/lib/module/RewardedAd.js +22 -22
  56. package/lib/module/RewardedAd.js.map +1 -1
  57. package/lib/module/hooks/useInterstitialAd.js +6 -6
  58. package/lib/module/hooks/useInterstitialAd.js.map +1 -1
  59. package/lib/module/hooks/useLightPopupAd.js +5 -5
  60. package/lib/module/hooks/useLightPopupAd.js.map +1 -1
  61. package/lib/module/hooks/useRewardedAd.js +6 -6
  62. package/lib/module/hooks/useRewardedAd.js.map +1 -1
  63. package/lib/module/nativeAd/NativeAdView.js +2 -2
  64. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  65. package/lib/typescript/commonjs/src/AppOpenAd.d.ts +8 -8
  66. package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts +3 -3
  68. package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts +3 -3
  70. package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/InterstitialAd.d.ts +8 -8
  72. package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/LightPopupAd.d.ts +9 -9
  74. package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +14 -14
  76. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/RewardedAd.d.ts +8 -8
  78. package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +1 -1
  80. package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +1 -1
  82. package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +1 -1
  84. package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/types/AdInfo.d.ts +2 -2
  86. package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/types/AdProps.d.ts +1 -1
  88. package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
  89. package/lib/typescript/module/src/AppOpenAd.d.ts +8 -8
  90. package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
  91. package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts +3 -3
  92. package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
  93. package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts +3 -3
  94. package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
  95. package/lib/typescript/module/src/InterstitialAd.d.ts +8 -8
  96. package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
  97. package/lib/typescript/module/src/LightPopupAd.d.ts +9 -9
  98. package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
  99. package/lib/typescript/module/src/NativeDaroModule.d.ts +14 -14
  100. package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
  101. package/lib/typescript/module/src/RewardedAd.d.ts +8 -8
  102. package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
  103. package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +1 -1
  104. package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -1
  105. package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +1 -1
  106. package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -1
  107. package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +1 -1
  108. package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -1
  109. package/lib/typescript/module/src/types/AdInfo.d.ts +2 -2
  110. package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
  111. package/lib/typescript/module/src/types/AdProps.d.ts +1 -1
  112. package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
  113. package/package.json +1 -1
  114. package/plugin/build/withAndroid.js +2 -2
  115. package/react-native-daro.podspec +1 -1
  116. package/src/AdBannerView.tsx +2 -2
  117. package/src/AppOpenAd.ts +21 -21
  118. package/src/DaroRNAdBannerViewNativeComponent.ts +3 -3
  119. package/src/DaroRNNativeAdViewNativeComponent.ts +3 -3
  120. package/src/InterstitialAd.ts +23 -23
  121. package/src/LightPopupAd.ts +26 -26
  122. package/src/NativeDaroModule.ts +14 -14
  123. package/src/RewardedAd.ts +21 -21
  124. package/src/hooks/useInterstitialAd.ts +6 -6
  125. package/src/hooks/useLightPopupAd.ts +5 -5
  126. package/src/hooks/useRewardedAd.ts +6 -6
  127. package/src/nativeAd/NativeAdView.tsx +2 -2
  128. package/src/types/AdInfo.ts +2 -2
  129. package/src/types/AdProps.ts +1 -1
package/README.md CHANGED
@@ -58,6 +58,6 @@ If an Android Release build fails in a SafeDK or manifest task with a
58
58
  Configuration Cache error, set Boolean `android.safedkConfigurationCacheWorkaround`
59
59
  to `true` in the plugin options and rerun prebuild or EAS Build. `false` disables
60
60
  the workaround; omission preserves the existing Gradle value. Generated Android
61
- builds use SDK 2.0.7 and Gradle plugin 2.0.3. React Native CLI projects can set
61
+ builds use SDK 2.0.9 and Gradle plugin 2.0.5. React Native CLI projects can set
62
62
  `daro.safedkConfigurationCacheWorkaround=true` in `android/gradle.properties`
63
- after updating the Gradle plugin to 2.0.3.
63
+ after updating the Gradle plugin to 2.0.5.
@@ -33,7 +33,7 @@ apply plugin: "kotlin-android"
33
33
  apply plugin: "com.facebook.react"
34
34
 
35
35
  // 통합 daro-sdk 는 AdMob·MAX 미디에이션을 한 아티팩트에 담는다 — 빌드타임 분기가 없다.
36
- def daroSdkDependency = "so.daro:daro-sdk:2.0.7"
36
+ def daroSdkDependency = "so.daro:daro-sdk:2.0.9"
37
37
  def isNewArchitectureEnabled =
38
38
  (project.hasProperty("newArchEnabled") && project.property("newArchEnabled").toString().toBoolean()) ||
39
39
  (project.hasProperty("react.newArchEnabled") && project.property("react.newArchEnabled").toString().toBoolean())
@@ -77,9 +77,9 @@ class DaroRNAdBannerViewManager : SimpleViewManager<DaroRNAdBannerViewContainer>
77
77
  view.setAdVisibility(isVisible)
78
78
  }
79
79
 
80
- @ReactProp(name = "adUnitId")
81
- override fun setAdUnitId(view: DaroRNAdBannerViewContainer, adUnitId: String?) {
82
- view.adUnitId = adUnitId.orEmpty()
80
+ @ReactProp(name = "adUnitKey")
81
+ override fun setAdUnitKey(view: DaroRNAdBannerViewContainer, adUnitKey: String?) {
82
+ view.adUnitKey = adUnitKey.orEmpty()
83
83
  }
84
84
 
85
85
  @ReactProp(name = "adFormat")
@@ -87,9 +87,9 @@ class DaroRNAdNativeViewManager : ViewGroupManager<DaroRNAdNativeViewContainer>(
87
87
  }
88
88
  }
89
89
 
90
- @ReactProp(name = "adUnitId")
91
- override fun setAdUnitId(view: DaroRNAdNativeViewContainer, adUnitId: String?) {
92
- view.adUnitId = adUnitId.orEmpty()
90
+ @ReactProp(name = "adUnitKey")
91
+ override fun setAdUnitKey(view: DaroRNAdNativeViewContainer, adUnitKey: String?) {
92
+ view.adUnitKey = adUnitKey.orEmpty()
93
93
  }
94
94
 
95
95
  @ReactProp(name = "loadOnMount")
@@ -219,9 +219,9 @@ class DaroRNModule(reactContext: ReactApplicationContext) :
219
219
  @OptIn(ExperimentalStdlibApi::class)
220
220
  internal abstract class DaroRNInterstitialModule(context: ReactContext) :
221
221
  DaroRNComponentModule(context) {
222
- abstract fun isInterstitialReady(requestId: Int, adUnitId: String, promise: Promise)
223
- abstract fun loadInterstitial(requestId: Int, adUnitId: String)
224
- abstract fun showInterstitial(requestId: Int, adUnitId: String)
222
+ abstract fun isInterstitialReady(requestId: Int, adUnitKey: String, promise: Promise)
223
+ abstract fun loadInterstitial(requestId: Int, adUnitKey: String)
224
+ abstract fun showInterstitial(requestId: Int, adUnitKey: String)
225
225
 
226
226
  override fun getComponents(): MutableMap<String, Any> {
227
227
  return InterstitialEvent.entries.associate { it.value to it.value }.toMutableMap()
@@ -235,28 +235,28 @@ class DaroRNModule(reactContext: ReactApplicationContext) :
235
235
  )
236
236
 
237
237
  @ReactMethod
238
- override fun isInterstitialReady(requestId: Double, adUnitId: String, promise: Promise) {
239
- daroRNInterstitialModule.isInterstitialReady(requestId.toInt(), adUnitId, promise)
238
+ override fun isInterstitialReady(requestId: Double, adUnitKey: String, promise: Promise) {
239
+ daroRNInterstitialModule.isInterstitialReady(requestId.toInt(), adUnitKey, promise)
240
240
  }
241
241
 
242
242
  @ReactMethod
243
- override fun loadInterstitial(requestId: Double, adUnitId: String, promise: Promise) {
244
- daroRNInterstitialModule.loadInterstitial(requestId.toInt(), adUnitId)
243
+ override fun loadInterstitial(requestId: Double, adUnitKey: String, promise: Promise) {
244
+ daroRNInterstitialModule.loadInterstitial(requestId.toInt(), adUnitKey)
245
245
  promise.resolve(null)
246
246
  }
247
247
 
248
248
  @ReactMethod
249
- override fun showInterstitial(requestId: Double, adUnitId: String, promise: Promise) {
250
- daroRNInterstitialModule.showInterstitial(requestId.toInt(), adUnitId)
249
+ override fun showInterstitial(requestId: Double, adUnitKey: String, promise: Promise) {
250
+ daroRNInterstitialModule.showInterstitial(requestId.toInt(), adUnitKey)
251
251
  promise.resolve(null)
252
252
  }
253
253
 
254
254
  @OptIn(ExperimentalStdlibApi::class)
255
255
  internal abstract class DaroRNRewardedModule(context: ReactContext) :
256
256
  DaroRNComponentModule(context) {
257
- abstract fun isRewardedAdReady(requestId: Int, adUnitId: String, promise: Promise)
258
- abstract fun loadRewardedAd(requestId: Int, adUnitId: String)
259
- abstract fun showRewardedAd(requestId: Int, adUnitId: String, customData: String?)
257
+ abstract fun isRewardedAdReady(requestId: Int, adUnitKey: String, promise: Promise)
258
+ abstract fun loadRewardedAd(requestId: Int, adUnitKey: String)
259
+ abstract fun showRewardedAd(requestId: Int, adUnitKey: String, customData: String?)
260
260
 
261
261
  override fun getComponents(): MutableMap<String, Any> {
262
262
  return RewardedEvent.entries.associate { it.value to it.value }.toMutableMap()
@@ -270,37 +270,37 @@ class DaroRNModule(reactContext: ReactApplicationContext) :
270
270
  )
271
271
 
272
272
  @ReactMethod
273
- override fun isRewardedAdReady(requestId: Double, adUnitId: String, promise: Promise) {
274
- daroRNRewardedModule.isRewardedAdReady(requestId.toInt(), adUnitId, promise)
273
+ override fun isRewardedAdReady(requestId: Double, adUnitKey: String, promise: Promise) {
274
+ daroRNRewardedModule.isRewardedAdReady(requestId.toInt(), adUnitKey, promise)
275
275
  }
276
276
 
277
277
  @ReactMethod
278
- override fun loadRewardedAd(requestId: Double, adUnitId: String, promise: Promise) {
279
- daroRNRewardedModule.loadRewardedAd(requestId.toInt(), adUnitId)
278
+ override fun loadRewardedAd(requestId: Double, adUnitKey: String, promise: Promise) {
279
+ daroRNRewardedModule.loadRewardedAd(requestId.toInt(), adUnitKey)
280
280
  promise.resolve(null)
281
281
  }
282
282
 
283
283
  @ReactMethod
284
284
  override fun showRewardedAd(
285
285
  requestId: Double,
286
- adUnitId: String,
286
+ adUnitKey: String,
287
287
  customData: String?,
288
288
  promise: Promise,
289
289
  ) {
290
- daroRNRewardedModule.showRewardedAd(requestId.toInt(), adUnitId, customData)
290
+ daroRNRewardedModule.showRewardedAd(requestId.toInt(), adUnitKey, customData)
291
291
  promise.resolve(null)
292
292
  }
293
293
 
294
294
  @OptIn(ExperimentalStdlibApi::class)
295
295
  internal abstract class DaroRNLightPopupModule(context: ReactContext) :
296
296
  DaroRNComponentModule(context) {
297
- abstract fun isLightPopupReady(requestId: Int, adUnitId: String, promise: Promise)
297
+ abstract fun isLightPopupReady(requestId: Int, adUnitKey: String, promise: Promise)
298
298
  abstract fun destroyLightPopup(requestId: Int)
299
299
  abstract fun invalidate()
300
- abstract fun loadLightPopup(requestId: Int, adUnitId: String)
301
- abstract fun showLightPopup(requestId: Int, adUnitId: String)
300
+ abstract fun loadLightPopup(requestId: Int, adUnitKey: String)
301
+ abstract fun showLightPopup(requestId: Int, adUnitKey: String)
302
302
 
303
- abstract fun setLightPopupAdConfiguration(requestId: Int, adUnitId: String, parameterMap: ReadableMap)
303
+ abstract fun setLightPopupAdConfiguration(requestId: Int, adUnitKey: String, parameterMap: ReadableMap)
304
304
 
305
305
  override fun getComponents(): MutableMap<String, Any> {
306
306
  return LightPopupEvent.entries.associate { it.value to it.value }.toMutableMap()
@@ -318,35 +318,35 @@ class DaroRNModule(reactContext: ReactApplicationContext) :
318
318
  }
319
319
 
320
320
  @ReactMethod
321
- override fun destroyLightPopup(requestId: Double, adUnitId: String) {
321
+ override fun destroyLightPopup(requestId: Double, adUnitKey: String) {
322
322
  daroRNLightPopupModule.destroyLightPopup(requestId.toInt())
323
323
  }
324
324
 
325
325
  @ReactMethod
326
- override fun isLightPopupReady(requestId: Double, adUnitId: String, promise: Promise) {
327
- daroRNLightPopupModule.isLightPopupReady(requestId.toInt(), adUnitId, promise)
326
+ override fun isLightPopupReady(requestId: Double, adUnitKey: String, promise: Promise) {
327
+ daroRNLightPopupModule.isLightPopupReady(requestId.toInt(), adUnitKey, promise)
328
328
  }
329
329
 
330
330
  @ReactMethod
331
- override fun loadLightPopup(requestId: Double, adUnitId: String, promise: Promise) {
332
- daroRNLightPopupModule.loadLightPopup(requestId.toInt(), adUnitId)
331
+ override fun loadLightPopup(requestId: Double, adUnitKey: String, promise: Promise) {
332
+ daroRNLightPopupModule.loadLightPopup(requestId.toInt(), adUnitKey)
333
333
  promise.resolve(null)
334
334
  }
335
335
 
336
336
  @ReactMethod
337
- override fun showLightPopup(requestId: Double, adUnitId: String, promise: Promise) {
338
- daroRNLightPopupModule.showLightPopup(requestId.toInt(), adUnitId)
337
+ override fun showLightPopup(requestId: Double, adUnitKey: String, promise: Promise) {
338
+ daroRNLightPopupModule.showLightPopup(requestId.toInt(), adUnitKey)
339
339
  promise.resolve(null)
340
340
  }
341
341
 
342
342
  @ReactMethod
343
343
  override fun setLightPopupAdConfiguration(
344
344
  requestId: Double,
345
- adUnitId: String,
345
+ adUnitKey: String,
346
346
  configuration: ReadableMap,
347
347
  promise: Promise,
348
348
  ) {
349
- daroRNLightPopupModule.setLightPopupAdConfiguration(requestId.toInt(), adUnitId, configuration)
349
+ daroRNLightPopupModule.setLightPopupAdConfiguration(requestId.toInt(), adUnitKey, configuration)
350
350
  promise.resolve(null)
351
351
  }
352
352
 
@@ -360,19 +360,19 @@ class DaroRNModule(reactContext: ReactApplicationContext) :
360
360
  private val daroRNAppOpenModule: DaroRNAppOpenModule = object : DaroRNAppOpenModule(reactContext) {}
361
361
 
362
362
  @ReactMethod
363
- override fun isAppOpenAdReady(requestId: Double, adUnitId: String, promise: Promise) {
363
+ override fun isAppOpenAdReady(requestId: Double, adUnitKey: String, promise: Promise) {
364
364
  promise.reject(APP_OPEN_UNSUPPORTED_CODE, APP_OPEN_UNSUPPORTED_MESSAGE)
365
365
  }
366
366
 
367
367
  @ReactMethod
368
- override fun loadAppOpenAd(requestId: Double, adUnitId: String, promise: Promise) {
368
+ override fun loadAppOpenAd(requestId: Double, adUnitKey: String, promise: Promise) {
369
369
  promise.reject(APP_OPEN_UNSUPPORTED_CODE, APP_OPEN_UNSUPPORTED_MESSAGE)
370
370
  }
371
371
 
372
372
  @ReactMethod
373
373
  override fun showAppOpenAd(
374
374
  requestId: Double,
375
- adUnitId: String,
375
+ adUnitKey: String,
376
376
  customData: String?,
377
377
  promise: Promise,
378
378
  ) {
@@ -27,36 +27,36 @@ internal class DaroRNInterstitialModuleImpl(
27
27
  private val interstitialAdMap: MutableMap<Int, DaroInterstitialAd> = mutableMapOf()
28
28
 
29
29
 
30
- override fun isInterstitialReady(requestId: Int, adUnitId: String, promise: Promise) {
30
+ override fun isInterstitialReady(requestId: Int, adUnitKey: String, promise: Promise) {
31
31
  promise.resolve(retrieveAd(requestId) != null)
32
32
  }
33
33
 
34
- override fun loadInterstitial(requestId: Int, adUnitId: String) {
35
- retrieveLoader(requestId, adUnitId).load()
34
+ override fun loadInterstitial(requestId: Int, adUnitKey: String) {
35
+ retrieveLoader(requestId, adUnitKey).load()
36
36
  }
37
37
 
38
- override fun showInterstitial(requestId: Int, adUnitId: String) {
38
+ override fun showInterstitial(requestId: Int, adUnitKey: String) {
39
39
  currentActivity?.let {
40
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(requestId, adUnitId, ad),
45
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, 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(requestId, adUnitId, ad, error),
52
+ params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitKey, 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(requestId, adUnitId, ad),
59
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, ad),
60
60
  )
61
61
 
62
62
  interstitialAdMap.remove(requestId)
@@ -65,14 +65,14 @@ internal class DaroRNInterstitialModuleImpl(
65
65
  override fun onAdClicked(responseInfo: DaroAdInfo) {
66
66
  sendNativeEvent(
67
67
  event = InterstitialEvent.ON_INTERSTITIAL_CLICKED_EVENT,
68
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
68
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, 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(requestId, adUnitId, responseInfo),
75
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, responseInfo),
76
76
  )
77
77
  }
78
78
  })
@@ -82,10 +82,10 @@ internal class DaroRNInterstitialModuleImpl(
82
82
  }
83
83
  }
84
84
 
85
- private fun retrieveLoader(requestId: Int, adUnitId: String): DaroInterstitialAdLoader {
85
+ private fun retrieveLoader(requestId: Int, adUnitKey: String): DaroInterstitialAdLoader {
86
86
  return loaderMap[requestId] ?: DaroInterstitialAdLoader(
87
87
  context,
88
- DaroInterstitialAdUnit(adUnitId)
88
+ DaroInterstitialAdUnit(adUnitKey)
89
89
  ).also {
90
90
  loaderMap[requestId] = it
91
91
  it.setListener(object : DaroInterstitialAdLoaderListener {
@@ -93,14 +93,14 @@ internal class DaroRNInterstitialModuleImpl(
93
93
  interstitialAdMap[requestId] = ad
94
94
  sendNativeEvent(
95
95
  event = InterstitialEvent.ON_INTERSTITIAL_LOADED_EVENT,
96
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
96
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, 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(requestId, adUnitId, err),
103
+ params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitKey, err),
104
104
  )
105
105
  }
106
106
  })
@@ -33,16 +33,16 @@ internal class DaroRNLightPopupModuleImpl(
33
33
  init { context.addLifecycleEventListener(this) }
34
34
  private val optionMap: MutableMap<Int, DaroLightPopupAdOptions> = mutableMapOf()
35
35
 
36
- override fun isLightPopupReady(requestId: Int, adUnitId: String, promise: Promise) {
36
+ override fun isLightPopupReady(requestId: Int, adUnitKey: String, promise: Promise) {
37
37
  context.runOnUiQueueThread { promise.resolve(requests[requestId]?.isReady == true) }
38
38
  }
39
39
 
40
- override fun loadLightPopup(requestId: Int, adUnitId: String) {
40
+ override fun loadLightPopup(requestId: Int, adUnitKey: String) {
41
41
  context.runOnUiQueueThread {
42
42
  if (invalidated) return@runOnUiQueueThread
43
43
  requests.remove(requestId)?.destroy()
44
44
  val loader = DaroLightPopupAdLoader(
45
- context, DaroLightPopupAdUnit(adUnitId, optionMap[requestId] ?: DaroLightPopupAdOptions())
45
+ context, DaroLightPopupAdUnit(adUnitKey, optionMap[requestId] ?: DaroLightPopupAdOptions())
46
46
  )
47
47
  val request = LightPopupRequest(loader::destroy, DaroLightPopupAd::destroy)
48
48
  requests[requestId] = request
@@ -50,12 +50,12 @@ internal class DaroRNLightPopupModuleImpl(
50
50
  override fun onAdLoadSuccess(ad: DaroLightPopupAd, responseInfo: DaroAdInfo) {
51
51
  if (!request.accept(ad)) return
52
52
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_LOADED_EVENT,
53
- AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo))
53
+ AdInfoUtil.getAdInfo(requestId, adUnitKey, responseInfo))
54
54
  }
55
55
  override fun onAdLoadFail(err: DaroAdLoadError) {
56
56
  if (!request.active) return
57
57
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_LOAD_FAILED_EVENT,
58
- AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitId, err))
58
+ AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitKey, err))
59
59
  }
60
60
  })
61
61
  loader.load()
@@ -64,7 +64,7 @@ internal class DaroRNLightPopupModuleImpl(
64
64
 
65
65
  override fun setLightPopupAdConfiguration(
66
66
  requestId: Int,
67
- adUnitId: String,
67
+ adUnitKey: String,
68
68
  parameterMap: ReadableMap,
69
69
  ) {
70
70
  val newOption = DaroLightPopupAdOptions().let {
@@ -94,7 +94,7 @@ internal class DaroRNLightPopupModuleImpl(
94
94
  }
95
95
  }
96
96
 
97
- override fun showLightPopup(requestId: Int, adUnitId: String) {
97
+ override fun showLightPopup(requestId: Int, adUnitKey: String) {
98
98
  context.runOnUiQueueThread {
99
99
  val activity = currentActivity ?: return@runOnUiQueueThread
100
100
  val request = requests[requestId] ?: return@runOnUiQueueThread
@@ -104,28 +104,28 @@ internal class DaroRNLightPopupModuleImpl(
104
104
  if (!request.ownsPresentation(popup)) return
105
105
  request.finishPresentation(popup)
106
106
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_HIDDEN_EVENT,
107
- AdInfoUtil.getAdInfo(requestId, adUnitId, ad))
107
+ AdInfoUtil.getAdInfo(requestId, adUnitKey, ad))
108
108
  }
109
109
  override fun onFailedToShow(ad: DaroAdInfo, error: DaroAdDisplayFailError) {
110
110
  if (!request.ownsPresentation(popup)) return
111
111
  request.finishPresentation(popup)
112
112
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT,
113
- AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitId, ad, error))
113
+ AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitKey, ad, error))
114
114
  }
115
115
  override fun onShown(ad: DaroAdInfo) {
116
116
  if (!request.ownsPresentation(popup)) return
117
117
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_DISPLAYED_EVENT,
118
- AdInfoUtil.getAdInfo(requestId, adUnitId, ad))
118
+ AdInfoUtil.getAdInfo(requestId, adUnitKey, ad))
119
119
  }
120
120
  override fun onAdClicked(responseInfo: DaroAdInfo) {
121
121
  if (!request.ownsPresentation(popup)) return
122
122
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_CLICKED_EVENT,
123
- AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo))
123
+ AdInfoUtil.getAdInfo(requestId, adUnitKey, responseInfo))
124
124
  }
125
125
  override fun onAdImpression(responseInfo: DaroAdInfo) {
126
126
  if (!request.ownsPresentation(popup)) return
127
127
  sendNativeEvent(LightPopupEvent.ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
128
- AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo))
128
+ AdInfoUtil.getAdInfo(requestId, adUnitKey, responseInfo))
129
129
  }
130
130
  })
131
131
  popup.show(activity)
@@ -26,36 +26,36 @@ internal class DaroRNRewardedAdModuleImpl(
26
26
  private val rewardedAdMap: MutableMap<Int, DaroRewardedAd> = mutableMapOf()
27
27
  private val loaderMap: MutableMap<Int, DaroRewardedAdLoader> = mutableMapOf()
28
28
 
29
- override fun isRewardedAdReady(requestId: Int, adUnitId: String, promise: Promise) {
29
+ override fun isRewardedAdReady(requestId: Int, adUnitKey: String, promise: Promise) {
30
30
  promise.resolve(retrieveAd(requestId) != null)
31
31
  }
32
32
 
33
- override fun loadRewardedAd(requestId: Int, adUnitId: String) {
34
- retrieveLoader(requestId, adUnitId).load()
33
+ override fun loadRewardedAd(requestId: Int, adUnitKey: String) {
34
+ retrieveLoader(requestId, adUnitKey).load()
35
35
  }
36
36
 
37
- override fun showRewardedAd(requestId: Int, adUnitId: String, customData: String?) {
37
+ override fun showRewardedAd(requestId: Int, adUnitKey: String, customData: String?) {
38
38
  currentActivity?.let { activity ->
39
39
  retrieveAd(requestId)?.apply {
40
40
  setListener(object : DaroRewardedAdListener {
41
41
  override fun onAdImpression(adInfo: DaroAdInfo) {
42
42
  sendNativeEvent(
43
43
  event = RewardedEvent.ON_REWARDED_AD_IMPRESSION_RECORDED,
44
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, adInfo),
44
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, adInfo),
45
45
  )
46
46
  }
47
47
 
48
48
  override fun onAdClicked(adInfo: DaroAdInfo) {
49
49
  sendNativeEvent(
50
50
  event = RewardedEvent.ON_REWARDED_AD_CLICKED_EVENT,
51
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, adInfo),
51
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, adInfo),
52
52
  )
53
53
  }
54
54
 
55
55
  override fun onDismiss(adInfo: DaroAdInfo) {
56
56
  sendNativeEvent(
57
57
  event = RewardedEvent.ON_REWARDED_AD_HIDDEN_EVENT,
58
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, adInfo),
58
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, adInfo),
59
59
  )
60
60
  }
61
61
 
@@ -65,7 +65,7 @@ internal class DaroRNRewardedAdModuleImpl(
65
65
  ) {
66
66
  sendNativeEvent(
67
67
  event = RewardedEvent.ON_REWARDED_AD_RECEIVED_REWARD_EVENT,
68
- params = AdInfoUtil.getRewardInfo(requestId, adUnitId, rewardItem),
68
+ params = AdInfoUtil.getRewardInfo(requestId, adUnitKey, rewardItem),
69
69
  )
70
70
  }
71
71
 
@@ -75,14 +75,14 @@ internal class DaroRNRewardedAdModuleImpl(
75
75
  ) {
76
76
  sendNativeEvent(
77
77
  event = RewardedEvent.ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT,
78
- params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitId, adInfo, error),
78
+ params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitKey, adInfo, error),
79
79
  )
80
80
  }
81
81
 
82
82
  override fun onShown(adInfo: DaroAdInfo) {
83
83
  sendNativeEvent(
84
84
  event = RewardedEvent.ON_REWARDED_AD_DISPLAYED_EVENT,
85
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, adInfo),
85
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, adInfo),
86
86
  )
87
87
 
88
88
  rewardedAdMap.remove(requestId)
@@ -97,10 +97,10 @@ internal class DaroRNRewardedAdModuleImpl(
97
97
  }
98
98
  }
99
99
 
100
- private fun retrieveLoader(requestId: Int, adUnitId: String): DaroRewardedAdLoader {
100
+ private fun retrieveLoader(requestId: Int, adUnitKey: String): DaroRewardedAdLoader {
101
101
  return loaderMap[requestId] ?: DaroRewardedAdLoader(
102
102
  context,
103
- DaroRewardedAdUnit(adUnitId)
103
+ DaroRewardedAdUnit(adUnitKey)
104
104
  ).also {
105
105
  loaderMap[requestId] = it
106
106
  it.setListener(
@@ -108,7 +108,7 @@ internal class DaroRNRewardedAdModuleImpl(
108
108
  override fun onAdLoadFail(err: DaroAdLoadError) {
109
109
  sendNativeEvent(
110
110
  event = RewardedEvent.ON_REWARDED_AD_LOAD_FAILED_EVENT,
111
- params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitId, err),
111
+ params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitKey, err),
112
112
  )
113
113
  }
114
114
 
@@ -120,7 +120,7 @@ internal class DaroRNRewardedAdModuleImpl(
120
120
 
121
121
  sendNativeEvent(
122
122
  event = RewardedEvent.ON_REWARDED_AD_LOADED_EVENT,
123
- params = AdInfoUtil.getAdInfo(requestId, adUnitId, adInfo),
123
+ params = AdInfoUtil.getAdInfo(requestId, adUnitKey, adInfo),
124
124
  )
125
125
  }
126
126
  }
@@ -10,9 +10,9 @@ import droom.daro.core.model.DaroRewardedAd
10
10
  internal object AdInfoUtil {
11
11
  // 모듈 경로(전면·리워드·앱오픈·라이트팝업)와 뷰 경로(배너·네이티브)가 **둘 다 여기를
12
12
  // 지난다.** 그래서 귀속을 여기 한 번만 실으면 모든 포맷이 같이 얻는다.
13
- fun getAdInfo(adUnitId: String, ad: DaroAdInfo): WritableMap {
13
+ fun getAdInfo(adUnitKey: String, ad: DaroAdInfo): WritableMap {
14
14
  val adInfo = Arguments.createMap()
15
- adInfo.putString("adUnitId", adUnitId)
15
+ adInfo.putString("adUnitKey", adUnitKey)
16
16
  adInfo.putInt("latencyMillis", ad.latency)
17
17
  // SDK 가 정한 어휘를 **그대로** 넘긴다 — 래퍼에서 매핑하지 않는다. 발행 tarball 이
18
18
  // android/ios 를 소스로 싣기 때문에 여기 매핑을 두면 그대로 읽힌다.
@@ -28,15 +28,15 @@ internal object AdInfoUtil {
28
28
  return adInfo
29
29
  }
30
30
 
31
- fun getAdInfo(requestId: Int, adUnitId: String, ad: DaroAdInfo): WritableMap {
32
- val adInfo = getAdInfo(adUnitId, ad)
31
+ fun getAdInfo(requestId: Int, adUnitKey: String, ad: DaroAdInfo): WritableMap {
32
+ val adInfo = getAdInfo(adUnitKey, ad)
33
33
  adInfo.putInt("requestId", requestId)
34
34
  return adInfo
35
35
  }
36
36
 
37
- fun getAdLoadFailedInfo(adUnitId: String?, error: DaroAdLoadError?): WritableMap {
37
+ fun getAdLoadFailedInfo(adUnitKey: String?, error: DaroAdLoadError?): WritableMap {
38
38
  val errInfo = Arguments.createMap()
39
- errInfo.putString("adUnitId", adUnitId)
39
+ errInfo.putString("adUnitKey", adUnitKey)
40
40
 
41
41
  if (error != null) {
42
42
  errInfo.putInt("code", error.code)
@@ -49,38 +49,38 @@ internal object AdInfoUtil {
49
49
  return errInfo
50
50
  }
51
51
 
52
- fun getAdLoadFailedInfo(requestId: Int, adUnitId: String?, error: DaroAdLoadError?): WritableMap {
53
- val errInfo = getAdLoadFailedInfo(adUnitId, error)
52
+ fun getAdLoadFailedInfo(requestId: Int, adUnitKey: String?, error: DaroAdLoadError?): WritableMap {
53
+ val errInfo = getAdLoadFailedInfo(adUnitKey, error)
54
54
  errInfo.putInt("requestId", requestId)
55
55
  return errInfo
56
56
  }
57
57
 
58
- fun getAdDisplayFailedInfo(adUnitId: String, ad: DaroAdInfo, error: DaroAdDisplayFailError): WritableMap {
59
- val info = getAdInfo(adUnitId, ad)
58
+ fun getAdDisplayFailedInfo(adUnitKey: String, ad: DaroAdInfo, error: DaroAdDisplayFailError): WritableMap {
59
+ val info = getAdInfo(adUnitKey, ad)
60
60
 
61
61
  info.putString("message", error.message)
62
62
 
63
63
  return info
64
64
  }
65
65
 
66
- fun getAdDisplayFailedInfo(requestId: Int, adUnitId: String, ad: DaroAdInfo, error: DaroAdDisplayFailError): WritableMap {
67
- val info = getAdDisplayFailedInfo(adUnitId, ad, error)
66
+ fun getAdDisplayFailedInfo(requestId: Int, adUnitKey: String, ad: DaroAdInfo, error: DaroAdDisplayFailError): WritableMap {
67
+ val info = getAdDisplayFailedInfo(adUnitKey, ad, error)
68
68
  info.putInt("requestId", requestId)
69
69
  return info
70
70
  }
71
71
 
72
- fun getRewardInfo(adUnitId: String, reward: DaroRewardedAd.DaroRewardedItem): WritableMap {
72
+ fun getRewardInfo(adUnitKey: String, reward: DaroRewardedAd.DaroRewardedItem): WritableMap {
73
73
  val adInfo = Arguments.createMap()
74
74
 
75
- adInfo.putString("adUnitId", adUnitId)
75
+ adInfo.putString("adUnitKey", adUnitKey)
76
76
  adInfo.putString("rewardLabel", reward.type)
77
77
  adInfo.putInt("rewardAmount", reward.amount)
78
78
 
79
79
  return adInfo
80
80
  }
81
81
 
82
- fun getRewardInfo(requestId: Int, adUnitId: String, reward: DaroRewardedAd.DaroRewardedItem): WritableMap {
83
- val info = getRewardInfo(adUnitId, reward)
82
+ fun getRewardInfo(requestId: Int, adUnitKey: String, reward: DaroRewardedAd.DaroRewardedItem): WritableMap {
83
+ val info = getRewardInfo(adUnitKey, reward)
84
84
  info.putInt("requestId", requestId)
85
85
  return info
86
86
  }
@@ -31,7 +31,7 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
31
31
 
32
32
  private var adView: DaroBannerAdView? = null
33
33
 
34
- internal var adUnitId: String = ""
34
+ internal var adUnitKey: String = ""
35
35
 
36
36
  internal var adSize: DaroBannerSize? = null
37
37
 
@@ -84,14 +84,14 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
84
84
  }
85
85
 
86
86
  private fun buildAdView(): DaroBannerAdView? {
87
- if (adUnitId.isEmpty() || adSize == null) {
87
+ if (adUnitKey.isEmpty() || adSize == null) {
88
88
  return null
89
89
  }
90
90
 
91
91
  return DaroBannerAdView(
92
92
  context,
93
93
  DaroBannerAdUnit(
94
- key = adUnitId,
94
+ adUnitKey,
95
95
  bannerSize = adSize!!,
96
96
  )
97
97
  ).also { view ->
@@ -161,7 +161,7 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
161
161
  sendNativeViewEvent(
162
162
  reactContext = context,
163
163
  event = AdViewEvent.ON_AD_CLICKED,
164
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo)
164
+ params = AdInfoUtil.getAdInfo(adUnitKey, adInfo)
165
165
  )
166
166
  }
167
167
 
@@ -169,7 +169,7 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
169
169
  sendNativeViewEvent(
170
170
  reactContext = context,
171
171
  event = AdViewEvent.ON_AD_IMPRESSION,
172
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo),
172
+ params = AdInfoUtil.getAdInfo(adUnitKey, adInfo),
173
173
  )
174
174
  }
175
175
 
@@ -177,7 +177,7 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
177
177
  sendNativeViewEvent(
178
178
  reactContext = context,
179
179
  event = AdViewEvent.ON_AD_FAILED_TO_LOAD,
180
- params = AdInfoUtil.getAdLoadFailedInfo(adUnitId, err),
180
+ params = AdInfoUtil.getAdLoadFailedInfo(adUnitKey, err),
181
181
  )
182
182
  }
183
183
 
@@ -190,7 +190,7 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
190
190
  sendNativeViewEvent(
191
191
  reactContext = context,
192
192
  event = AdViewEvent.ON_AD_LOADED,
193
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo),
193
+ params = AdInfoUtil.getAdInfo(adUnitKey, adInfo),
194
194
  )
195
195
 
196
196
  post {
@@ -411,6 +411,6 @@ class DaroRNAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(co
411
411
  }
412
412
 
413
413
  private fun canBuildAdView(): Boolean {
414
- return adUnitId.isNotEmpty() && adSize != null
414
+ return adUnitKey.isNotEmpty() && adSize != null
415
415
  }
416
416
  }