react-native-daro 2.0.6 → 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.
- package/README.md +2 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/daro/reactnative/DaroRNAdBannerViewManager.kt +3 -3
- package/android/src/main/java/com/daro/reactnative/DaroRNAdNativeViewManager.kt +3 -3
- package/android/src/main/java/com/daro/reactnative/DaroRNModule.kt +34 -34
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNInterstitialModuleImpl.kt +13 -13
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNLightPopupModuleImpl.kt +12 -12
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNRewardedAdModuleImpl.kt +14 -14
- package/android/src/main/java/com/daro/reactnative/util/AdInfoUtil.kt +16 -16
- package/android/src/main/java/com/daro/reactnative/view/DaroRNAdBannerViewContainer.kt +8 -8
- package/android/src/main/java/com/daro/reactnative/view/DaroRNAdNativeViewContainer.kt +8 -8
- package/android/src/oldarch/java/com/daro/reactnative/DaroRNModuleSpec.kt +14 -14
- package/ios/DaroRNModule+AppOpen.swift +9 -9
- package/ios/DaroRNModule+Interstitial.swift +9 -9
- package/ios/DaroRNModule+LightPopup.swift +13 -13
- package/ios/DaroRNModule+Rewarded.swift +14 -14
- package/ios/DaroRNModule.mm +14 -14
- package/ios/DaroRNModule.swift +1 -1
- package/ios/Fabric/DaroRNAdBannerComponentView.mm +7 -7
- package/ios/Fabric/DaroRNNativeAdComponentView.mm +7 -7
- package/ios/Paper/DaroRNAdBannerViewManager.m +1 -1
- package/ios/Paper/DaroRNNativeAdViewManager.m +1 -1
- package/ios/Shared/DaroRNBannerAdView.swift +8 -8
- package/ios/Shared/DaroRNNativeAdView.swift +14 -14
- package/lib/commonjs/AdBannerView.js +2 -2
- package/lib/commonjs/AdBannerView.js.map +1 -1
- package/lib/commonjs/AppOpenAd.js +22 -22
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/DaroRNAdBannerViewNativeComponent.ts +3 -3
- package/lib/commonjs/DaroRNNativeAdViewNativeComponent.ts +3 -3
- package/lib/commonjs/InterstitialAd.js +24 -24
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/LightPopupAd.js +27 -27
- package/lib/commonjs/LightPopupAd.js.map +1 -1
- package/lib/commonjs/RewardedAd.js +22 -22
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/hooks/useInterstitialAd.js +6 -6
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -1
- package/lib/commonjs/hooks/useLightPopupAd.js +5 -5
- package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -1
- package/lib/commonjs/hooks/useRewardedAd.js +6 -6
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +2 -2
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/AdBannerView.js +2 -2
- package/lib/module/AdBannerView.js.map +1 -1
- package/lib/module/AppOpenAd.js +22 -22
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/DaroRNAdBannerViewNativeComponent.ts +3 -3
- package/lib/module/DaroRNNativeAdViewNativeComponent.ts +3 -3
- package/lib/module/InterstitialAd.js +24 -24
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/LightPopupAd.js +27 -27
- package/lib/module/LightPopupAd.js.map +1 -1
- package/lib/module/RewardedAd.js +22 -22
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/hooks/useInterstitialAd.js +6 -6
- package/lib/module/hooks/useInterstitialAd.js.map +1 -1
- package/lib/module/hooks/useLightPopupAd.js +5 -5
- package/lib/module/hooks/useLightPopupAd.js.map +1 -1
- package/lib/module/hooks/useRewardedAd.js +6 -6
- package/lib/module/hooks/useRewardedAd.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +2 -2
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts +3 -3
- package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts +3 -3
- package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts +9 -9
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +14 -14
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/RewardedAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts +2 -2
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/module/src/AppOpenAd.d.ts +8 -8
- package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts +3 -3
- package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts +3 -3
- package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/InterstitialAd.d.ts +8 -8
- package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/LightPopupAd.d.ts +9 -9
- package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts +14 -14
- package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/module/src/RewardedAd.d.ts +8 -8
- package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdInfo.d.ts +2 -2
- package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/build/withAndroid.js +2 -2
- package/react-native-daro.podspec +1 -1
- package/src/AdBannerView.tsx +2 -2
- package/src/AppOpenAd.ts +21 -21
- package/src/DaroRNAdBannerViewNativeComponent.ts +3 -3
- package/src/DaroRNNativeAdViewNativeComponent.ts +3 -3
- package/src/InterstitialAd.ts +23 -23
- package/src/LightPopupAd.ts +26 -26
- package/src/NativeDaroModule.ts +14 -14
- package/src/RewardedAd.ts +21 -21
- package/src/hooks/useInterstitialAd.ts +6 -6
- package/src/hooks/useLightPopupAd.ts +5 -5
- package/src/hooks/useRewardedAd.ts +6 -6
- package/src/nativeAd/NativeAdView.tsx +2 -2
- package/src/types/AdInfo.ts +2 -2
- 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.
|
|
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.
|
|
63
|
+
after updating the Gradle plugin to 2.0.5.
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
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 = "
|
|
81
|
-
override fun
|
|
82
|
-
view.
|
|
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 = "
|
|
91
|
-
override fun
|
|
92
|
-
view.
|
|
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,
|
|
223
|
-
abstract fun loadInterstitial(requestId: Int,
|
|
224
|
-
abstract fun showInterstitial(requestId: Int,
|
|
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,
|
|
239
|
-
daroRNInterstitialModule.isInterstitialReady(requestId.toInt(),
|
|
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,
|
|
244
|
-
daroRNInterstitialModule.loadInterstitial(requestId.toInt(),
|
|
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,
|
|
250
|
-
daroRNInterstitialModule.showInterstitial(requestId.toInt(),
|
|
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,
|
|
258
|
-
abstract fun loadRewardedAd(requestId: Int,
|
|
259
|
-
abstract fun showRewardedAd(requestId: Int,
|
|
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,
|
|
274
|
-
daroRNRewardedModule.isRewardedAdReady(requestId.toInt(),
|
|
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,
|
|
279
|
-
daroRNRewardedModule.loadRewardedAd(requestId.toInt(),
|
|
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
|
-
|
|
286
|
+
adUnitKey: String,
|
|
287
287
|
customData: String?,
|
|
288
288
|
promise: Promise,
|
|
289
289
|
) {
|
|
290
|
-
daroRNRewardedModule.showRewardedAd(requestId.toInt(),
|
|
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,
|
|
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,
|
|
301
|
-
abstract fun showLightPopup(requestId: Int,
|
|
300
|
+
abstract fun loadLightPopup(requestId: Int, adUnitKey: String)
|
|
301
|
+
abstract fun showLightPopup(requestId: Int, adUnitKey: String)
|
|
302
302
|
|
|
303
|
-
abstract fun setLightPopupAdConfiguration(requestId: Int,
|
|
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,
|
|
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,
|
|
327
|
-
daroRNLightPopupModule.isLightPopupReady(requestId.toInt(),
|
|
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,
|
|
332
|
-
daroRNLightPopupModule.loadLightPopup(requestId.toInt(),
|
|
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,
|
|
338
|
-
daroRNLightPopupModule.showLightPopup(requestId.toInt(),
|
|
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
|
-
|
|
345
|
+
adUnitKey: String,
|
|
346
346
|
configuration: ReadableMap,
|
|
347
347
|
promise: Promise,
|
|
348
348
|
) {
|
|
349
|
-
daroRNLightPopupModule.setLightPopupAdConfiguration(requestId.toInt(),
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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,
|
|
35
|
-
retrieveLoader(requestId,
|
|
34
|
+
override fun loadInterstitial(requestId: Int, adUnitKey: String) {
|
|
35
|
+
retrieveLoader(requestId, adUnitKey).load()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
override fun showInterstitial(requestId: Int,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
85
|
+
private fun retrieveLoader(requestId: Int, adUnitKey: String): DaroInterstitialAdLoader {
|
|
86
86
|
return loaderMap[requestId] ?: DaroInterstitialAdLoader(
|
|
87
87
|
context,
|
|
88
|
-
DaroInterstitialAdUnit(
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
34
|
-
retrieveLoader(requestId,
|
|
33
|
+
override fun loadRewardedAd(requestId: Int, adUnitKey: String) {
|
|
34
|
+
retrieveLoader(requestId, adUnitKey).load()
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
override fun showRewardedAd(requestId: Int,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
100
|
+
private fun retrieveLoader(requestId: Int, adUnitKey: String): DaroRewardedAdLoader {
|
|
101
101
|
return loaderMap[requestId] ?: DaroRewardedAdLoader(
|
|
102
102
|
context,
|
|
103
|
-
DaroRewardedAdUnit(
|
|
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,
|
|
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,
|
|
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(
|
|
13
|
+
fun getAdInfo(adUnitKey: String, ad: DaroAdInfo): WritableMap {
|
|
14
14
|
val adInfo = Arguments.createMap()
|
|
15
|
-
adInfo.putString("
|
|
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,
|
|
32
|
-
val adInfo = getAdInfo(
|
|
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(
|
|
37
|
+
fun getAdLoadFailedInfo(adUnitKey: String?, error: DaroAdLoadError?): WritableMap {
|
|
38
38
|
val errInfo = Arguments.createMap()
|
|
39
|
-
errInfo.putString("
|
|
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,
|
|
53
|
-
val errInfo = getAdLoadFailedInfo(
|
|
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(
|
|
59
|
-
val info = getAdInfo(
|
|
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,
|
|
67
|
-
val info = getAdDisplayFailedInfo(
|
|
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(
|
|
72
|
+
fun getRewardInfo(adUnitKey: String, reward: DaroRewardedAd.DaroRewardedItem): WritableMap {
|
|
73
73
|
val adInfo = Arguments.createMap()
|
|
74
74
|
|
|
75
|
-
adInfo.putString("
|
|
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,
|
|
83
|
-
val info = getRewardInfo(
|
|
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
|
|
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 (
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
414
|
+
return adUnitKey.isNotEmpty() && adSize != null
|
|
415
415
|
}
|
|
416
416
|
}
|