react-native-daro 1.0.16 → 2.0.0
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 -5
- package/android/build.gradle +7 -13
- package/android/src/main/java/com/daro/reactnative/DaroRNAdBannerViewManager.kt +105 -0
- package/android/src/main/java/com/daro/reactnative/{DaroMAdNativeViewManager.kt → DaroRNAdNativeViewManager.kt} +34 -38
- package/android/src/main/java/com/daro/reactnative/DaroRNModule.kt +388 -0
- package/android/src/main/java/com/daro/reactnative/{DaroMPackage.kt → DaroRNPackage.kt} +7 -7
- package/android/src/main/java/com/daro/reactnative/DaroSdkBridge.kt +52 -0
- package/android/src/main/java/com/daro/reactnative/constants/{InternalDaroMBannerSize.kt → InternalDaroRNBannerSize.kt} +2 -2
- package/android/src/main/java/com/daro/reactnative/event/{DaroMEvent.kt → DaroRNEvent.kt} +8 -7
- package/android/src/main/java/com/daro/reactnative/impl/{DaroMBannerViewModuleImpl.kt → DaroRNBannerViewModuleImpl.kt} +3 -3
- package/android/src/main/java/com/daro/reactnative/impl/{DaroMInterstitialModuleImpl.kt → DaroRNInterstitialModuleImpl.kt} +4 -4
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNLightPopupModuleImpl.kt +163 -0
- package/android/src/main/java/com/daro/reactnative/impl/{DaroMRewardedAdModuleImpl.kt → DaroRNRewardedAdModuleImpl.kt} +4 -4
- package/android/src/main/java/com/daro/reactnative/impl/LightPopupRequest.kt +51 -0
- package/android/src/main/java/com/daro/reactnative/util/AdInfoUtil.kt +12 -0
- package/android/src/main/java/com/daro/reactnative/util/DaroQaProbe.kt +147 -0
- package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +2 -2
- package/android/src/main/java/com/daro/reactnative/view/{DaroMAdBannerViewContainer.kt → DaroRNAdBannerViewContainer.kt} +2 -3
- package/android/src/main/java/com/daro/reactnative/view/{DaroMAdNativeViewContainer.kt → DaroRNAdNativeViewContainer.kt} +23 -4
- package/android/src/newarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +1 -1
- package/android/src/oldarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +35 -3
- package/android/src/test/java/com/daro/reactnative/impl/LightPopupRequestTest.kt +62 -0
- package/ios/{DaroMModule+AppOpen.swift → DaroRNModule+AppOpen.swift} +10 -11
- package/ios/DaroRNModule+Consent.swift +88 -0
- package/ios/{DaroMModule+Interstitial.swift → DaroRNModule+Interstitial.swift} +9 -9
- package/ios/DaroRNModule+LightPopup.swift +211 -0
- package/ios/DaroRNModule+Qa.swift +159 -0
- package/ios/{DaroMModule+Rewarded.swift → DaroRNModule+Rewarded.swift} +10 -10
- package/ios/{DaroMModule.mm → DaroRNModule.mm} +20 -4
- package/ios/{DaroMModule.swift → DaroRNModule.swift} +32 -6
- package/ios/Fabric/DaroRNAdBannerComponentView.mm +219 -0
- package/ios/Fabric/{DaroMFabricEventSink.mm → DaroRNFabricEventSink.mm} +4 -4
- package/ios/Fabric/{DaroMFabricPropApplier.mm → DaroRNFabricPropApplier.mm} +14 -14
- package/ios/Fabric/DaroRNNativeAdComponentView.mm +320 -0
- package/ios/Paper/{DaroMAdBannerViewManager.m → DaroRNAdBannerViewManager.m} +1 -1
- package/ios/Paper/{DaroMAdBannerViewManager.swift → DaroRNAdBannerViewManager.swift} +5 -5
- package/ios/Paper/{DaroMNativeAdViewManager.m → DaroRNNativeAdViewManager.m} +2 -1
- package/ios/Paper/DaroRNNativeAdViewManager.swift +22 -0
- package/ios/Shared/DaroMediationDebugger.swift +14 -0
- package/ios/Shared/{DaroMAdEventSink.swift → DaroRNAdEventSink.swift} +2 -1
- package/ios/Shared/{DaroMBannerAdView.swift → DaroRNBannerAdView.swift} +11 -11
- package/ios/Shared/{DaroMNativeAdLoadCoordinator.swift → DaroRNNativeAdLoadCoordinator.swift} +4 -4
- package/ios/Shared/{DaroMNativeAdView.swift → DaroRNNativeAdView.swift} +29 -21
- package/ios/Shared/{DaroMNativeAssetResolver.swift → DaroRNNativeAssetResolver.swift} +6 -6
- package/lib/commonjs/AdBannerView.js +3 -5
- package/lib/commonjs/AdBannerView.js.map +1 -1
- package/lib/commonjs/AppOpenAd.js +4 -4
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/{DaroMAdBannerViewNativeComponent.ts → DaroRNAdBannerViewNativeComponent.ts} +5 -2
- package/{src/DaroMNativeAdViewNativeComponent.ts → lib/commonjs/DaroRNNativeAdViewNativeComponent.ts} +8 -2
- package/lib/commonjs/LightPopupAd.js +15 -1
- package/lib/commonjs/LightPopupAd.js.map +1 -1
- package/lib/commonjs/NativeDaroModule.js +1 -1
- package/lib/commonjs/NativeDaroModule.js.map +1 -1
- package/lib/commonjs/hooks/useLightPopupAd.js +6 -4
- package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -1
- package/lib/commonjs/index.js +121 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +10 -3
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/types/NativeAdViewProps.js +21 -0
- package/lib/commonjs/types/NativeAdViewProps.js.map +1 -1
- package/lib/module/AdBannerView.js +1 -3
- package/lib/module/AdBannerView.js.map +1 -1
- package/lib/module/AppOpenAd.js +4 -4
- package/lib/module/AppOpenAd.js.map +1 -1
- package/{src/DaroMAdBannerViewNativeComponent.ts → lib/module/DaroRNAdBannerViewNativeComponent.ts} +5 -2
- package/lib/{commonjs/DaroMNativeAdViewNativeComponent.ts → module/DaroRNNativeAdViewNativeComponent.ts} +8 -2
- package/lib/module/LightPopupAd.js +15 -1
- package/lib/module/LightPopupAd.js.map +1 -1
- package/lib/module/NativeDaroModule.js +1 -1
- package/lib/module/NativeDaroModule.js.map +1 -1
- package/lib/module/hooks/useLightPopupAd.js +6 -4
- package/lib/module/hooks/useLightPopupAd.js.map +1 -1
- package/lib/module/index.js +101 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +8 -1
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/types/NativeAdViewProps.js +22 -1
- package/lib/module/types/NativeAdViewProps.js.map +1 -1
- package/lib/typescript/commonjs/plugin/src/index.d.ts +2 -6
- package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +2 -6
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/src/withIos.d.ts +2 -6
- package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts +2 -2
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
- package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +6 -2
- package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts +3 -0
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +11 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +79 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +2 -0
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts +15 -0
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts +0 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +9 -0
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/index.d.ts +2 -6
- package/lib/typescript/module/plugin/src/index.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/withAndroid.d.ts +2 -6
- package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/withIos.d.ts +2 -6
- package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -1
- package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/module/src/AppOpenAd.d.ts +2 -2
- package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/module/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
- package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +6 -2
- package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/LightPopupAd.d.ts +3 -0
- package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts +11 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +79 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +2 -0
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdInfo.d.ts +15 -0
- package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts +0 -1
- package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +9 -0
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/package.json +8 -5
- package/plugin/build/index.d.ts +2 -6
- package/plugin/build/index.js +21 -56
- package/plugin/build/withAndroid.d.ts +2 -6
- package/plugin/build/withAndroid.js +48 -90
- package/plugin/build/withIos.d.ts +2 -6
- package/plugin/build/withIos.js +37 -33
- package/react-native-daro.podspec +2 -3
- package/src/AdBannerView.tsx +1 -3
- package/src/AppOpenAd.ts +2 -8
- package/{lib/module/DaroMAdBannerViewNativeComponent.ts → src/DaroRNAdBannerViewNativeComponent.ts} +5 -2
- package/{lib/module/DaroMNativeAdViewNativeComponent.ts → src/DaroRNNativeAdViewNativeComponent.ts} +8 -2
- package/src/LightPopupAd.ts +18 -1
- package/src/NativeDaroModule.ts +18 -2
- package/src/hooks/useLightPopupAd.ts +6 -4
- package/src/index.tsx +136 -0
- package/src/nativeAd/NativeAdView.tsx +22 -1
- package/src/types/AdInfo.ts +17 -0
- package/src/types/AdProps.ts +0 -2
- package/src/types/NativeAdViewProps.ts +10 -0
- package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +0 -23
- package/android/src/main/java/com/daro/reactnative/DaroMAdBannerViewManager.kt +0 -155
- package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +0 -257
- package/android/src/main/java/com/daro/reactnative/impl/DaroMLightPopupModuleImpl.kt +0 -150
- package/ios/DaroMModule+LightPopup.swift +0 -183
- package/ios/Fabric/DaroMAdBannerComponentView.mm +0 -207
- package/ios/Fabric/DaroMNativeAdComponentView.mm +0 -294
- package/ios/Paper/DaroMNativeAdViewManager.swift +0 -22
- package/ios/mediation/admob/DaroMediationDebugger.swift +0 -11
- package/lib/commonjs/types/DaroMMobileAds.js +0 -2
- package/lib/commonjs/types/DaroMMobileAds.js.map +0 -1
- package/lib/module/types/DaroMMobileAds.js +0 -2
- package/lib/module/types/DaroMMobileAds.js.map +0 -1
- package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts +0 -6
- package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +0 -1
- package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/types/DaroMMobileAds.d.ts +0 -6
- package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +0 -1
- package/src/types/DaroMMobileAds.ts +0 -5
- /package/ios/{mediation/admob → Shared}/DaroMediationTypes.swift +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
package com.daro.reactnative.impl
|
|
2
|
-
|
|
3
|
-
import android.app.Activity
|
|
4
|
-
import androidx.core.graphics.toColorInt
|
|
5
|
-
import com.daro.reactnative.DaroMModule
|
|
6
|
-
import com.daro.reactnative.event.LightPopupEvent
|
|
7
|
-
import com.daro.reactnative.util.AdInfoUtil
|
|
8
|
-
import com.facebook.react.bridge.Promise
|
|
9
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
10
|
-
import com.facebook.react.bridge.ReadableMap
|
|
11
|
-
import droom.daro.core.adunit.DaroLightPopupAdUnit
|
|
12
|
-
import droom.daro.core.listener.DaroLightPopupAdListener
|
|
13
|
-
import droom.daro.core.listener.DaroLightPopupAdLoaderListener
|
|
14
|
-
import droom.daro.core.model.DaroAdDisplayFailError
|
|
15
|
-
import droom.daro.core.model.DaroAdInfo
|
|
16
|
-
import droom.daro.core.model.DaroAdLoadError
|
|
17
|
-
import droom.daro.core.model.DaroLightPopupAd
|
|
18
|
-
import droom.daro.core.model.DaroLightPopupAdOptions
|
|
19
|
-
import droom.daro.loader.DaroLightPopupAdLoader
|
|
20
|
-
|
|
21
|
-
internal class DaroMLightPopupModuleImpl(
|
|
22
|
-
context: ReactApplicationContext,
|
|
23
|
-
private val getCurrentActivity: () -> Activity?,
|
|
24
|
-
) : DaroMModule.DaroMLightPopupModule(context) {
|
|
25
|
-
|
|
26
|
-
private val currentActivity: Activity?
|
|
27
|
-
get() = getCurrentActivity()
|
|
28
|
-
|
|
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
|
-
|
|
33
|
-
override fun isLightPopupReady(requestId: Int, adUnitId: String, promise: Promise) {
|
|
34
|
-
promise.resolve(retrieveAd(requestId) != null)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
override fun loadLightPopup(requestId: Int, adUnitId: String) {
|
|
38
|
-
context.runOnUiQueueThread {
|
|
39
|
-
retrieveLoader(requestId, adUnitId).load()
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override fun setLightPopupAdConfiguration(
|
|
44
|
-
requestId: Int,
|
|
45
|
-
adUnitId: String,
|
|
46
|
-
parameterMap: ReadableMap,
|
|
47
|
-
) {
|
|
48
|
-
val newOption = DaroLightPopupAdOptions().let {
|
|
49
|
-
it.copy(
|
|
50
|
-
backgroundColor = parameterMap.getString("backgroundColor")?.toColorInt()
|
|
51
|
-
?: it.backgroundColor,
|
|
52
|
-
containerColor = parameterMap.getString("cardViewBackgroundColor")?.toColorInt()
|
|
53
|
-
?: it.containerColor,
|
|
54
|
-
adMarkLabelTextColor = parameterMap.getString("adMarkLabelTextColor")?.toColorInt()
|
|
55
|
-
?: it.adMarkLabelTextColor,
|
|
56
|
-
adMarkLabelBackgroundColor = parameterMap.getString("adMarkLabelBackgroundColor")
|
|
57
|
-
?.toColorInt() ?: it.adMarkLabelBackgroundColor,
|
|
58
|
-
titleColor = parameterMap.getString("titleTextColor")?.toColorInt() ?: it.titleColor,
|
|
59
|
-
bodyColor = parameterMap.getString("bodyTextColor")?.toColorInt() ?: it.bodyColor,
|
|
60
|
-
ctaBackgroundColor = parameterMap.getString("ctaButtonBackgroundColor")?.toColorInt()
|
|
61
|
-
?: it.ctaBackgroundColor,
|
|
62
|
-
ctaTextColor = parameterMap.getString("ctaButtonTextColor")?.toColorInt()
|
|
63
|
-
?: it.ctaTextColor,
|
|
64
|
-
closeButtonText = parameterMap.getString("closeButtonText") ?: it.closeButtonText,
|
|
65
|
-
closeButtonColor = parameterMap.getString("closeButtonTextColor")?.toColorInt()
|
|
66
|
-
?: it.closeButtonColor,
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
optionMap[requestId] = newOption
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
override fun showLightPopup(requestId: Int, adUnitId: String) {
|
|
74
|
-
currentActivity?.let {
|
|
75
|
-
it.runOnUiThread {
|
|
76
|
-
retrieveAd(requestId)?.apply {
|
|
77
|
-
setListener(object : DaroLightPopupAdListener {
|
|
78
|
-
override fun onDismiss(ad: DaroAdInfo) {
|
|
79
|
-
sendNativeEvent(
|
|
80
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_HIDDEN_EVENT,
|
|
81
|
-
params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
override fun onFailedToShow(ad: DaroAdInfo, error: DaroAdDisplayFailError) {
|
|
86
|
-
sendNativeEvent(
|
|
87
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_AD_FAILED_TO_DISPLAY_EVENT,
|
|
88
|
-
params = AdInfoUtil.getAdDisplayFailedInfo(requestId, adUnitId, ad, error),
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
override fun onShown(ad: DaroAdInfo) {
|
|
93
|
-
sendNativeEvent(
|
|
94
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_DISPLAYED_EVENT,
|
|
95
|
-
params = AdInfoUtil.getAdInfo(requestId, adUnitId, ad),
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
lightpopupAdMap.remove(requestId)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
override fun onAdClicked(responseInfo: DaroAdInfo) {
|
|
102
|
-
sendNativeEvent(
|
|
103
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_CLICKED_EVENT,
|
|
104
|
-
params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
override fun onAdImpression(responseInfo: DaroAdInfo) {
|
|
109
|
-
sendNativeEvent(
|
|
110
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED,
|
|
111
|
-
params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
show(it)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
private fun retrieveLoader(requestId: Int, adUnitId: String): DaroLightPopupAdLoader {
|
|
123
|
-
return loaderMap[requestId] ?: DaroLightPopupAdLoader(
|
|
124
|
-
context,
|
|
125
|
-
DaroLightPopupAdUnit(adUnitId, adUnitId, optionMap[requestId] ?: DaroLightPopupAdOptions())
|
|
126
|
-
).also {
|
|
127
|
-
loaderMap[requestId] = it
|
|
128
|
-
it.setListener(object : DaroLightPopupAdLoaderListener {
|
|
129
|
-
override fun onAdLoadSuccess(ad: DaroLightPopupAd, responseInfo: DaroAdInfo) {
|
|
130
|
-
lightpopupAdMap[requestId] = ad
|
|
131
|
-
sendNativeEvent(
|
|
132
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_LOADED_EVENT,
|
|
133
|
-
params = AdInfoUtil.getAdInfo(requestId, adUnitId, responseInfo),
|
|
134
|
-
)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
override fun onAdLoadFail(err: DaroAdLoadError) {
|
|
138
|
-
sendNativeEvent(
|
|
139
|
-
event = LightPopupEvent.ON_LIGHTPOPUP_LOAD_FAILED_EVENT,
|
|
140
|
-
params = AdInfoUtil.getAdLoadFailedInfo(requestId, adUnitId, err),
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
private fun retrieveAd(requestId: Int): DaroLightPopupAd? {
|
|
148
|
-
return lightpopupAdMap[requestId]
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import UIKit
|
|
3
|
-
// MARK: - LightPopup Ad
|
|
4
|
-
extension DaroMModule {
|
|
5
|
-
|
|
6
|
-
@objc(isLightPopupReady:adUnitId:resolve:reject:)
|
|
7
|
-
func isLightPopupReady(
|
|
8
|
-
requestId: Double,
|
|
9
|
-
adUnitId: String,
|
|
10
|
-
resolve: RCTPromiseResolveBlock,
|
|
11
|
-
reject: RCTPromiseRejectBlock
|
|
12
|
-
) {
|
|
13
|
-
let requestId = Int(requestId)
|
|
14
|
-
if !Self.sdkInitialized {
|
|
15
|
-
DaroMModule.logger.debug("[DaroMMobileAds] !isInitialized")
|
|
16
|
-
resolve(false)
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
resolve(lightPopups[requestId]?.loadedAd != nil)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@objc(loadLightPopup:adUnitId:resolve:reject:)
|
|
23
|
-
func loadLightPopup(
|
|
24
|
-
requestId: Double,
|
|
25
|
-
adUnitId: String,
|
|
26
|
-
resolve: RCTPromiseResolveBlock,
|
|
27
|
-
reject: RCTPromiseRejectBlock
|
|
28
|
-
) {
|
|
29
|
-
let requestId = Int(requestId)
|
|
30
|
-
let lightPopupLoader = retrieveLightPopupLoader(requestId: requestId, adUnitId: adUnitId)
|
|
31
|
-
lightPopupLoader.loadAd()
|
|
32
|
-
resolve(Void())
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@objc(showLightPopup:adUnitId:resolve:reject:)
|
|
36
|
-
func showLightPopup(
|
|
37
|
-
requestId: Double,
|
|
38
|
-
adUnitId: String,
|
|
39
|
-
resolve: @escaping RCTPromiseResolveBlock,
|
|
40
|
-
reject: @escaping RCTPromiseRejectBlock
|
|
41
|
-
) {
|
|
42
|
-
let requestId = Int(requestId)
|
|
43
|
-
guard let loadedAd = lightPopups[requestId]?.loadedAd else {
|
|
44
|
-
reject("LIGHTPOPUP_NOT_LOADED", "LightPopup ad not loaded", nil)
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
let reqIdInt = requestId
|
|
48
|
-
executeOnMainThread { [weak self] in
|
|
49
|
-
guard let viewController = UIApplication.shared.windows.first?.rootViewController else {
|
|
50
|
-
reject("VIEW_CONTROLLER_NOT_FOUND", "Root view controller not found", nil)
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
self?.applyStoredConfiguration(to: loadedAd, for: reqIdInt)
|
|
54
|
-
loadedAd.show(viewController: viewController)
|
|
55
|
-
resolve(Void())
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@objc(setLightPopupAdConfiguration:adUnitId:configuration:resolve:reject:)
|
|
60
|
-
func setLightPopupAdConfiguration(
|
|
61
|
-
requestId: Double,
|
|
62
|
-
adUnitId: String,
|
|
63
|
-
configuration: [String: Any],
|
|
64
|
-
resolve: RCTPromiseResolveBlock,
|
|
65
|
-
reject: RCTPromiseRejectBlock
|
|
66
|
-
) {
|
|
67
|
-
let reqIdInt = Int(requestId)
|
|
68
|
-
guard let loadedAd = lightPopups[reqIdInt]?.loadedAd else {
|
|
69
|
-
lightPopupConfigurations[reqIdInt] = configuration
|
|
70
|
-
resolve(Void())
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
lightPopupConfigurations[reqIdInt] = configuration
|
|
74
|
-
executeOnMainThread { [weak self] in
|
|
75
|
-
self?.applyStoredConfiguration(to: loadedAd, for: reqIdInt)
|
|
76
|
-
}
|
|
77
|
-
resolve(Void())
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
func applyStoredConfiguration(to ad: DaroLightPopupAd, for requestId: Int) {
|
|
81
|
-
if let configuration = lightPopupConfigurations[requestId] {
|
|
82
|
-
let lightPopupConfig = DaroLightPopupConfiguration()
|
|
83
|
-
|
|
84
|
-
func setColorIfValid(_ key: String, setter: (UIColor) -> Void) {
|
|
85
|
-
if let colorString = configuration[key] as? String {
|
|
86
|
-
setter(UIColor(hex: colorString))
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
setColorIfValid("backgroundColor") { lightPopupConfig.backgroundColor = $0 }
|
|
91
|
-
setColorIfValid("cardViewBackgroundColor") { lightPopupConfig.cardViewBackgroundColor = $0 }
|
|
92
|
-
setColorIfValid("adMarkLabelTextColor") { lightPopupConfig.adMarkLabelTextColor = $0 }
|
|
93
|
-
setColorIfValid("adMarkLabelBackgroundColor") { lightPopupConfig.adMarkLabelBackgroundColor = $0 }
|
|
94
|
-
setColorIfValid("closeButtonTextColor") { lightPopupConfig.closeButtonTextColor = $0 }
|
|
95
|
-
setColorIfValid("titleTextColor") { lightPopupConfig.titleTextColor = $0 }
|
|
96
|
-
setColorIfValid("bodyTextColor") { lightPopupConfig.bodyTextColor = $0 }
|
|
97
|
-
setColorIfValid("ctaButtonTextColor") { lightPopupConfig.ctaButtonTextColor = $0 }
|
|
98
|
-
setColorIfValid("ctaButtonBackgroundColor") { lightPopupConfig.ctaButtonBackgroundColor = $0 }
|
|
99
|
-
|
|
100
|
-
if let closeButtonText = configuration["closeButtonText"] as? String {
|
|
101
|
-
lightPopupConfig.closeButtonText = closeButtonText
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
ad.configuration = lightPopupConfig
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
func retrieveLightPopupLoader(requestId: Int, adUnitId: String) -> DaroLightPopupAdLoader {
|
|
109
|
-
if let lightPopupAd = lightPopups[requestId] {
|
|
110
|
-
return lightPopupAd.loader
|
|
111
|
-
} else {
|
|
112
|
-
let lightPopupLoader = DaroLightPopupAdLoader(unit: DaroAdUnit(unitId: adUnitId))
|
|
113
|
-
|
|
114
|
-
lightPopupLoader.listener.onAdClicked = { [weak self] adInfo in
|
|
115
|
-
self?.sendEvent(with: .onLightPopupClickedEvent, body: adInfo?.toBody(requestId: requestId))
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
lightPopupLoader.listener.onAdImpression = { [weak self] adInfo in
|
|
119
|
-
self?.lightPopups[requestId]?.loadedAd = nil
|
|
120
|
-
self?.sendEvent(with: .onLightPopupAdImpressionRecordedEvent, body: adInfo?.toBody(requestId: requestId))
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
lightPopupLoader.listener.onAdLoadSuccess = { [weak self] ad, adInfo in
|
|
124
|
-
self?.lightPopups[requestId]?.loadedAd = ad
|
|
125
|
-
self?.sendEvent(with: .onLightPopupLoadedEvent, body: adInfo?.toBody(requestId: requestId))
|
|
126
|
-
self?.setupLightPopupListener(for: ad, requestId: requestId)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
lightPopupLoader.listener.onAdLoadFail = { [weak self] error in
|
|
130
|
-
self?.sendEvent(with: .onLightPopupLoadFailedEvent, body: error.toBody(requestId: requestId))
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
self.lightPopups[requestId] = LightPopupAd(loader: lightPopupLoader)
|
|
134
|
-
return lightPopupLoader
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private func setupLightPopupListener(for ad: DaroLightPopupAd, requestId: Int) {
|
|
139
|
-
ad.lightPopupAdListener.onShown = { [weak self] adInfo in
|
|
140
|
-
self?.sendEvent(with: .onLightPopupDisplayedEvent, body: adInfo?.toBody(requestId: requestId))
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
ad.lightPopupAdListener.onDismiss = { [weak self] adInfo in
|
|
144
|
-
self?.sendEvent(with: .onLightPopupHiddenEvent, body: adInfo?.toBody(requestId: requestId))
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
ad.lightPopupAdListener.onFailedToShow = { [weak self] adInfo, error in
|
|
148
|
-
self?.sendEvent(with: .onLightPopupAdFailedToDisplayEvent, body: adInfo?.toBody(requestId: requestId))
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// 메인 스레드에서 실행하는 헬퍼 메서드
|
|
153
|
-
private func executeOnMainThread<T>(_ block: () -> T) -> T {
|
|
154
|
-
if Thread.isMainThread {
|
|
155
|
-
return block()
|
|
156
|
-
} else {
|
|
157
|
-
var result: T!
|
|
158
|
-
DispatchQueue.main.sync {
|
|
159
|
-
result = block()
|
|
160
|
-
}
|
|
161
|
-
return result
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
extension DaroLightPopupConfiguration {
|
|
167
|
-
convenience init(from configuration: [String: Any]) {
|
|
168
|
-
self.init()
|
|
169
|
-
func setColorIfValid(_ key: String, setter: (UIColor) -> Void) {
|
|
170
|
-
if let colorString = configuration[key] as? String {
|
|
171
|
-
setter(UIColor(hex: colorString))
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
setColorIfValid("backgroundColor") { self.backgroundColor = $0 }
|
|
176
|
-
setColorIfValid("cardViewBackgroundColor") { self.cardViewBackgroundColor = $0 }
|
|
177
|
-
setColorIfValid("adMarkLabelTextColor") { self.adMarkLabelTextColor = $0 }
|
|
178
|
-
setColorIfValid("adMarkLabelBackgroundColor") { self.adMarkLabelBackgroundColor = $0 }
|
|
179
|
-
setColorIfValid("closeButtonTextColor") { self.closeButtonTextColor = $0 }
|
|
180
|
-
setColorIfValid("titleTextColor") { self.titleTextColor = $0 }
|
|
181
|
-
setColorIfValid("bodyTextColor") { self.bodyTextColor = $0 }
|
|
182
|
-
}
|
|
183
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
#import <React/RCTDefines.h>
|
|
2
|
-
|
|
3
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
-
|
|
5
|
-
#import <React/RCTComponent.h>
|
|
6
|
-
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
|
-
#import <React/RCTViewComponentView.h>
|
|
8
|
-
#import <react/renderer/components/DaroReactNativeSpec/ComponentDescriptors.h>
|
|
9
|
-
#import <react/renderer/components/DaroReactNativeSpec/EventEmitters.h>
|
|
10
|
-
#import <react/renderer/components/DaroReactNativeSpec/Props.h>
|
|
11
|
-
#import <react/renderer/components/DaroReactNativeSpec/RCTComponentViewHelpers.h>
|
|
12
|
-
#include <folly/dynamic.h>
|
|
13
|
-
#include <string>
|
|
14
|
-
|
|
15
|
-
using namespace facebook::react;
|
|
16
|
-
|
|
17
|
-
extern UIView *DaroMFabricCreateSwiftView(NSString *className);
|
|
18
|
-
extern void DaroMFabricSetValue(UIView *view, NSString *key, id value);
|
|
19
|
-
extern void DaroMFabricPerformSelector(UIView *view, SEL selector);
|
|
20
|
-
extern void DaroMFabricPerformSelectorWithObject(UIView *view, SEL selector, id object);
|
|
21
|
-
extern NSString *DaroMFabricNSStringFromStdString(const std::string &value);
|
|
22
|
-
extern NSDictionary *DaroMFabricEventBody(NSDictionary *body);
|
|
23
|
-
extern std::string DaroMFabricEventString(NSDictionary *body, NSString *key);
|
|
24
|
-
extern double DaroMFabricEventDouble(NSDictionary *body, NSString *key);
|
|
25
|
-
extern int DaroMFabricEventInt(NSDictionary *body, NSString *key);
|
|
26
|
-
|
|
27
|
-
@interface DaroMAdBannerViewComponentView : RCTViewComponentView <RCTDaroMAdBannerViewViewProtocol>
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
@implementation DaroMAdBannerViewComponentView {
|
|
31
|
-
UIView *_bannerView;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
+ (void)load
|
|
35
|
-
{
|
|
36
|
-
[super load];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
40
|
-
{
|
|
41
|
-
if (self = [super initWithFrame:frame]) {
|
|
42
|
-
static const auto defaultProps = std::make_shared<const DaroMAdBannerViewProps>();
|
|
43
|
-
_props = defaultProps;
|
|
44
|
-
[self createBannerView];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return self;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
- (void)createBannerView
|
|
51
|
-
{
|
|
52
|
-
_bannerView = DaroMFabricCreateSwiftView(@"DaroMAdBannerView");
|
|
53
|
-
self.contentView = _bannerView;
|
|
54
|
-
[self installEventHandlers];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
- (void)installEventHandlers
|
|
58
|
-
{
|
|
59
|
-
__weak DaroMAdBannerViewComponentView *weakSelf = self;
|
|
60
|
-
|
|
61
|
-
RCTDirectEventBlock onAdLoadedEvent = ^(NSDictionary *body) {
|
|
62
|
-
DaroMAdBannerViewComponentView *strongSelf = weakSelf;
|
|
63
|
-
if (!strongSelf) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
auto eventEmitter = std::static_pointer_cast<const DaroMAdBannerViewEventEmitter>(strongSelf->_eventEmitter);
|
|
68
|
-
if (!eventEmitter) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
73
|
-
eventEmitter->onAdLoadedEvent({
|
|
74
|
-
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
75
|
-
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
RCTDirectEventBlock onAdLoadFailedEvent = ^(NSDictionary *body) {
|
|
80
|
-
DaroMAdBannerViewComponentView *strongSelf = weakSelf;
|
|
81
|
-
if (!strongSelf) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
auto eventEmitter = std::static_pointer_cast<const DaroMAdBannerViewEventEmitter>(strongSelf->_eventEmitter);
|
|
86
|
-
if (!eventEmitter) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
91
|
-
eventEmitter->onAdLoadFailedEvent({
|
|
92
|
-
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
93
|
-
.code = DaroMFabricEventInt(eventBody, @"code"),
|
|
94
|
-
.message = DaroMFabricEventString(eventBody, @"message"),
|
|
95
|
-
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
RCTDirectEventBlock onAdClickedEvent = ^(NSDictionary *body) {
|
|
100
|
-
DaroMAdBannerViewComponentView *strongSelf = weakSelf;
|
|
101
|
-
if (!strongSelf) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
auto eventEmitter = std::static_pointer_cast<const DaroMAdBannerViewEventEmitter>(strongSelf->_eventEmitter);
|
|
106
|
-
if (!eventEmitter) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
111
|
-
eventEmitter->onAdClickedEvent({
|
|
112
|
-
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
113
|
-
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
RCTDirectEventBlock onAdImpressionRecordedEvent = ^(NSDictionary *body) {
|
|
118
|
-
DaroMAdBannerViewComponentView *strongSelf = weakSelf;
|
|
119
|
-
if (!strongSelf) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
auto eventEmitter = std::static_pointer_cast<const DaroMAdBannerViewEventEmitter>(strongSelf->_eventEmitter);
|
|
124
|
-
if (!eventEmitter) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
129
|
-
eventEmitter->onAdImpressionRecordedEvent({
|
|
130
|
-
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
131
|
-
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
DaroMFabricSetValue(_bannerView, @"onAdLoadedEvent", onAdLoadedEvent);
|
|
136
|
-
DaroMFabricSetValue(_bannerView, @"onAdLoadFailedEvent", onAdLoadFailedEvent);
|
|
137
|
-
DaroMFabricSetValue(_bannerView, @"onAdClickedEvent", onAdClickedEvent);
|
|
138
|
-
DaroMFabricSetValue(_bannerView, @"onAdImpressionRecordedEvent", onAdImpressionRecordedEvent);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
142
|
-
{
|
|
143
|
-
return concreteComponentDescriptorProvider<DaroMAdBannerViewComponentDescriptor>();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
147
|
-
{
|
|
148
|
-
const auto &oldComponentProps = *std::static_pointer_cast<const DaroMAdBannerViewProps>(_props);
|
|
149
|
-
const auto &newComponentProps = *std::static_pointer_cast<const DaroMAdBannerViewProps>(props);
|
|
150
|
-
NSMutableArray<NSString *> *changedProps = [NSMutableArray new];
|
|
151
|
-
|
|
152
|
-
if (oldComponentProps.adUnitId != newComponentProps.adUnitId) {
|
|
153
|
-
DaroMFabricSetValue(_bannerView, @"adUnitId", DaroMFabricNSStringFromStdString(newComponentProps.adUnitId));
|
|
154
|
-
[changedProps addObject:@"adUnitId"];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (oldComponentProps.adFormat != newComponentProps.adFormat) {
|
|
158
|
-
DaroMFabricSetValue(_bannerView, @"adFormat", DaroMFabricNSStringFromStdString(newComponentProps.adFormat));
|
|
159
|
-
[changedProps addObject:@"adFormat"];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (oldComponentProps.loadOnMount != newComponentProps.loadOnMount) {
|
|
163
|
-
DaroMFabricSetValue(_bannerView, @"loadOnMount", @(newComponentProps.loadOnMount));
|
|
164
|
-
[changedProps addObject:@"loadOnMount"];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (oldComponentProps.isVisible != newComponentProps.isVisible) {
|
|
168
|
-
DaroMFabricSetValue(_bannerView, @"isVisible", @(newComponentProps.isVisible));
|
|
169
|
-
[changedProps addObject:@"isVisible"];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
[super updateProps:props oldProps:oldProps];
|
|
173
|
-
|
|
174
|
-
DaroMFabricPerformSelectorWithObject(_bannerView, NSSelectorFromString(@"applyReactProps:"), changedProps);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
- (void)loadAd
|
|
178
|
-
{
|
|
179
|
-
DaroMFabricPerformSelector(_bannerView, NSSelectorFromString(@"loadAd"));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|
|
183
|
-
{
|
|
184
|
-
RCTDaroMAdBannerViewHandleCommand(self, commandName, args);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
- (void)prepareForRecycle
|
|
188
|
-
{
|
|
189
|
-
[super prepareForRecycle];
|
|
190
|
-
DaroMFabricSetValue(_bannerView, @"onAdLoadedEvent", nil);
|
|
191
|
-
DaroMFabricSetValue(_bannerView, @"onAdLoadFailedEvent", nil);
|
|
192
|
-
DaroMFabricSetValue(_bannerView, @"onAdClickedEvent", nil);
|
|
193
|
-
DaroMFabricSetValue(_bannerView, @"onAdImpressionRecordedEvent", nil);
|
|
194
|
-
DaroMFabricPerformSelector(_bannerView, NSSelectorFromString(@"prepareForReuse"));
|
|
195
|
-
[self installEventHandlers];
|
|
196
|
-
static const auto defaultProps = std::make_shared<const DaroMAdBannerViewProps>();
|
|
197
|
-
_props = defaultProps;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@end
|
|
201
|
-
|
|
202
|
-
Class<RCTComponentViewProtocol> DaroMAdBannerViewCls(void)
|
|
203
|
-
{
|
|
204
|
-
return DaroMAdBannerViewComponentView.class;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
#endif
|