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.
Files changed (179) hide show
  1. package/README.md +2 -5
  2. package/android/build.gradle +7 -13
  3. package/android/src/main/java/com/daro/reactnative/DaroRNAdBannerViewManager.kt +105 -0
  4. package/android/src/main/java/com/daro/reactnative/{DaroMAdNativeViewManager.kt → DaroRNAdNativeViewManager.kt} +34 -38
  5. package/android/src/main/java/com/daro/reactnative/DaroRNModule.kt +388 -0
  6. package/android/src/main/java/com/daro/reactnative/{DaroMPackage.kt → DaroRNPackage.kt} +7 -7
  7. package/android/src/main/java/com/daro/reactnative/DaroSdkBridge.kt +52 -0
  8. package/android/src/main/java/com/daro/reactnative/constants/{InternalDaroMBannerSize.kt → InternalDaroRNBannerSize.kt} +2 -2
  9. package/android/src/main/java/com/daro/reactnative/event/{DaroMEvent.kt → DaroRNEvent.kt} +8 -7
  10. package/android/src/main/java/com/daro/reactnative/impl/{DaroMBannerViewModuleImpl.kt → DaroRNBannerViewModuleImpl.kt} +3 -3
  11. package/android/src/main/java/com/daro/reactnative/impl/{DaroMInterstitialModuleImpl.kt → DaroRNInterstitialModuleImpl.kt} +4 -4
  12. package/android/src/main/java/com/daro/reactnative/impl/DaroRNLightPopupModuleImpl.kt +163 -0
  13. package/android/src/main/java/com/daro/reactnative/impl/{DaroMRewardedAdModuleImpl.kt → DaroRNRewardedAdModuleImpl.kt} +4 -4
  14. package/android/src/main/java/com/daro/reactnative/impl/LightPopupRequest.kt +51 -0
  15. package/android/src/main/java/com/daro/reactnative/util/AdInfoUtil.kt +12 -0
  16. package/android/src/main/java/com/daro/reactnative/util/DaroQaProbe.kt +147 -0
  17. package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +2 -2
  18. package/android/src/main/java/com/daro/reactnative/view/{DaroMAdBannerViewContainer.kt → DaroRNAdBannerViewContainer.kt} +2 -3
  19. package/android/src/main/java/com/daro/reactnative/view/{DaroMAdNativeViewContainer.kt → DaroRNAdNativeViewContainer.kt} +23 -4
  20. package/android/src/newarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +1 -1
  21. package/android/src/oldarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +35 -3
  22. package/android/src/test/java/com/daro/reactnative/impl/LightPopupRequestTest.kt +62 -0
  23. package/ios/{DaroMModule+AppOpen.swift → DaroRNModule+AppOpen.swift} +10 -11
  24. package/ios/DaroRNModule+Consent.swift +88 -0
  25. package/ios/{DaroMModule+Interstitial.swift → DaroRNModule+Interstitial.swift} +9 -9
  26. package/ios/DaroRNModule+LightPopup.swift +211 -0
  27. package/ios/DaroRNModule+Qa.swift +159 -0
  28. package/ios/{DaroMModule+Rewarded.swift → DaroRNModule+Rewarded.swift} +10 -10
  29. package/ios/{DaroMModule.mm → DaroRNModule.mm} +20 -4
  30. package/ios/{DaroMModule.swift → DaroRNModule.swift} +32 -6
  31. package/ios/Fabric/DaroRNAdBannerComponentView.mm +219 -0
  32. package/ios/Fabric/{DaroMFabricEventSink.mm → DaroRNFabricEventSink.mm} +4 -4
  33. package/ios/Fabric/{DaroMFabricPropApplier.mm → DaroRNFabricPropApplier.mm} +14 -14
  34. package/ios/Fabric/DaroRNNativeAdComponentView.mm +320 -0
  35. package/ios/Paper/{DaroMAdBannerViewManager.m → DaroRNAdBannerViewManager.m} +1 -1
  36. package/ios/Paper/{DaroMAdBannerViewManager.swift → DaroRNAdBannerViewManager.swift} +5 -5
  37. package/ios/Paper/{DaroMNativeAdViewManager.m → DaroRNNativeAdViewManager.m} +2 -1
  38. package/ios/Paper/DaroRNNativeAdViewManager.swift +22 -0
  39. package/ios/Shared/DaroMediationDebugger.swift +14 -0
  40. package/ios/Shared/{DaroMAdEventSink.swift → DaroRNAdEventSink.swift} +2 -1
  41. package/ios/Shared/{DaroMBannerAdView.swift → DaroRNBannerAdView.swift} +11 -11
  42. package/ios/Shared/{DaroMNativeAdLoadCoordinator.swift → DaroRNNativeAdLoadCoordinator.swift} +4 -4
  43. package/ios/Shared/{DaroMNativeAdView.swift → DaroRNNativeAdView.swift} +29 -21
  44. package/ios/Shared/{DaroMNativeAssetResolver.swift → DaroRNNativeAssetResolver.swift} +6 -6
  45. package/lib/commonjs/AdBannerView.js +3 -5
  46. package/lib/commonjs/AdBannerView.js.map +1 -1
  47. package/lib/commonjs/AppOpenAd.js +4 -4
  48. package/lib/commonjs/AppOpenAd.js.map +1 -1
  49. package/lib/commonjs/{DaroMAdBannerViewNativeComponent.ts → DaroRNAdBannerViewNativeComponent.ts} +5 -2
  50. package/{src/DaroMNativeAdViewNativeComponent.ts → lib/commonjs/DaroRNNativeAdViewNativeComponent.ts} +8 -2
  51. package/lib/commonjs/LightPopupAd.js +15 -1
  52. package/lib/commonjs/LightPopupAd.js.map +1 -1
  53. package/lib/commonjs/NativeDaroModule.js +1 -1
  54. package/lib/commonjs/NativeDaroModule.js.map +1 -1
  55. package/lib/commonjs/hooks/useLightPopupAd.js +6 -4
  56. package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -1
  57. package/lib/commonjs/index.js +121 -0
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/nativeAd/NativeAdView.js +10 -3
  60. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  61. package/lib/commonjs/types/NativeAdViewProps.js +21 -0
  62. package/lib/commonjs/types/NativeAdViewProps.js.map +1 -1
  63. package/lib/module/AdBannerView.js +1 -3
  64. package/lib/module/AdBannerView.js.map +1 -1
  65. package/lib/module/AppOpenAd.js +4 -4
  66. package/lib/module/AppOpenAd.js.map +1 -1
  67. package/{src/DaroMAdBannerViewNativeComponent.ts → lib/module/DaroRNAdBannerViewNativeComponent.ts} +5 -2
  68. package/lib/{commonjs/DaroMNativeAdViewNativeComponent.ts → module/DaroRNNativeAdViewNativeComponent.ts} +8 -2
  69. package/lib/module/LightPopupAd.js +15 -1
  70. package/lib/module/LightPopupAd.js.map +1 -1
  71. package/lib/module/NativeDaroModule.js +1 -1
  72. package/lib/module/NativeDaroModule.js.map +1 -1
  73. package/lib/module/hooks/useLightPopupAd.js +6 -4
  74. package/lib/module/hooks/useLightPopupAd.js.map +1 -1
  75. package/lib/module/index.js +101 -0
  76. package/lib/module/index.js.map +1 -1
  77. package/lib/module/nativeAd/NativeAdView.js +8 -1
  78. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  79. package/lib/module/types/NativeAdViewProps.js +22 -1
  80. package/lib/module/types/NativeAdViewProps.js.map +1 -1
  81. package/lib/typescript/commonjs/plugin/src/index.d.ts +2 -6
  82. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +2 -6
  84. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/plugin/src/withIos.d.ts +2 -6
  86. package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/AppOpenAd.d.ts +2 -2
  89. package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
  91. package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +6 -2
  93. package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/LightPopupAd.d.ts +3 -0
  95. package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +11 -1
  97. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/index.d.ts +79 -0
  100. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +2 -0
  102. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/src/types/AdInfo.d.ts +15 -0
  104. package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/src/types/AdProps.d.ts +0 -1
  106. package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +9 -0
  108. package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
  109. package/lib/typescript/module/plugin/src/index.d.ts +2 -6
  110. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -1
  111. package/lib/typescript/module/plugin/src/withAndroid.d.ts +2 -6
  112. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -1
  113. package/lib/typescript/module/plugin/src/withIos.d.ts +2 -6
  114. package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -1
  115. package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
  116. package/lib/typescript/module/src/AppOpenAd.d.ts +2 -2
  117. package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
  118. package/lib/typescript/module/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
  119. package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
  120. package/lib/typescript/module/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +6 -2
  121. package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
  122. package/lib/typescript/module/src/LightPopupAd.d.ts +3 -0
  123. package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
  124. package/lib/typescript/module/src/NativeDaroModule.d.ts +11 -1
  125. package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
  126. package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -1
  127. package/lib/typescript/module/src/index.d.ts +79 -0
  128. package/lib/typescript/module/src/index.d.ts.map +1 -1
  129. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +2 -0
  130. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
  131. package/lib/typescript/module/src/types/AdInfo.d.ts +15 -0
  132. package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
  133. package/lib/typescript/module/src/types/AdProps.d.ts +0 -1
  134. package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
  135. package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +9 -0
  136. package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
  137. package/package.json +8 -5
  138. package/plugin/build/index.d.ts +2 -6
  139. package/plugin/build/index.js +21 -56
  140. package/plugin/build/withAndroid.d.ts +2 -6
  141. package/plugin/build/withAndroid.js +48 -90
  142. package/plugin/build/withIos.d.ts +2 -6
  143. package/plugin/build/withIos.js +37 -33
  144. package/react-native-daro.podspec +2 -3
  145. package/src/AdBannerView.tsx +1 -3
  146. package/src/AppOpenAd.ts +2 -8
  147. package/{lib/module/DaroMAdBannerViewNativeComponent.ts → src/DaroRNAdBannerViewNativeComponent.ts} +5 -2
  148. package/{lib/module/DaroMNativeAdViewNativeComponent.ts → src/DaroRNNativeAdViewNativeComponent.ts} +8 -2
  149. package/src/LightPopupAd.ts +18 -1
  150. package/src/NativeDaroModule.ts +18 -2
  151. package/src/hooks/useLightPopupAd.ts +6 -4
  152. package/src/index.tsx +136 -0
  153. package/src/nativeAd/NativeAdView.tsx +22 -1
  154. package/src/types/AdInfo.ts +17 -0
  155. package/src/types/AdProps.ts +0 -2
  156. package/src/types/NativeAdViewProps.ts +10 -0
  157. package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +0 -23
  158. package/android/src/main/java/com/daro/reactnative/DaroMAdBannerViewManager.kt +0 -155
  159. package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +0 -257
  160. package/android/src/main/java/com/daro/reactnative/impl/DaroMLightPopupModuleImpl.kt +0 -150
  161. package/ios/DaroMModule+LightPopup.swift +0 -183
  162. package/ios/Fabric/DaroMAdBannerComponentView.mm +0 -207
  163. package/ios/Fabric/DaroMNativeAdComponentView.mm +0 -294
  164. package/ios/Paper/DaroMNativeAdViewManager.swift +0 -22
  165. package/ios/mediation/admob/DaroMediationDebugger.swift +0 -11
  166. package/lib/commonjs/types/DaroMMobileAds.js +0 -2
  167. package/lib/commonjs/types/DaroMMobileAds.js.map +0 -1
  168. package/lib/module/types/DaroMMobileAds.js +0 -2
  169. package/lib/module/types/DaroMMobileAds.js.map +0 -1
  170. package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
  171. package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
  172. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts +0 -6
  173. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +0 -1
  174. package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
  175. package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
  176. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts +0 -6
  177. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +0 -1
  178. package/src/types/DaroMMobileAds.ts +0 -5
  179. /package/ios/{mediation/admob → Shared}/DaroMediationTypes.swift +0 -0
@@ -0,0 +1,320 @@
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 *DaroRNFabricCreateSwiftView(NSString *className);
18
+ extern void DaroRNFabricSetValue(UIView *view, NSString *key, id value);
19
+ extern void DaroRNFabricPerformSelector(UIView *view, SEL selector);
20
+ extern void DaroRNFabricPerformSelectorWithObject(UIView *view, SEL selector, id object);
21
+ extern void DaroRNFabricPerformSelectorWithTwoObjects(UIView *view, SEL selector, id firstObject, id secondObject);
22
+ extern NSString *DaroRNFabricNSStringFromStdString(const std::string &value);
23
+ extern id DaroRNFabricIdFromDynamic(const folly::dynamic &value);
24
+ extern NSDictionary *DaroRNFabricEventBody(NSDictionary *body);
25
+ extern std::string DaroRNFabricEventString(NSDictionary *body, NSString *key);
26
+ extern double DaroRNFabricEventDouble(NSDictionary *body, NSString *key);
27
+ extern int DaroRNFabricEventInt(NSDictionary *body, NSString *key);
28
+
29
+ static NSString *DaroRNFabricAdChoicesPositionString(DaroRNNativeAdViewAdChoicesPosition position)
30
+ {
31
+ switch (position) {
32
+ case DaroRNNativeAdViewAdChoicesPosition::TopLeft:
33
+ return @"topLeft";
34
+ case DaroRNNativeAdViewAdChoicesPosition::TopRight:
35
+ return @"topRight";
36
+ case DaroRNNativeAdViewAdChoicesPosition::BottomLeft:
37
+ return @"bottomLeft";
38
+ case DaroRNNativeAdViewAdChoicesPosition::BottomRight:
39
+ default:
40
+ return @"bottomRight";
41
+ }
42
+ }
43
+
44
+ @interface DaroRNNativeAdViewComponentView : RCTViewComponentView <RCTDaroRNNativeAdViewViewProtocol>
45
+ @end
46
+
47
+ @implementation DaroRNNativeAdViewComponentView {
48
+ UIView *_nativeAdView;
49
+ }
50
+
51
+ + (void)load
52
+ {
53
+ [super load];
54
+ }
55
+
56
+ - (instancetype)initWithFrame:(CGRect)frame
57
+ {
58
+ if (self = [super initWithFrame:frame]) {
59
+ static const auto defaultProps = std::make_shared<const DaroRNNativeAdViewProps>();
60
+ _props = defaultProps;
61
+ [self createNativeAdView];
62
+ }
63
+
64
+ return self;
65
+ }
66
+
67
+ - (void)createNativeAdView
68
+ {
69
+ _nativeAdView = DaroRNFabricCreateSwiftView(@"RNDaroRNNativeAdView");
70
+ _nativeAdView.frame = self.bounds;
71
+ _nativeAdView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
72
+ DaroRNFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), _nativeAdView);
73
+ [self addSubview:_nativeAdView];
74
+ [self installEventHandlers];
75
+ }
76
+
77
+ - (void)installEventHandlers
78
+ {
79
+ __weak DaroRNNativeAdViewComponentView *weakSelf = self;
80
+
81
+ RCTDirectEventBlock onNativeAdAssetLoadedEvent = ^(NSDictionary *body) {
82
+ DaroRNNativeAdViewComponentView *strongSelf = weakSelf;
83
+ if (!strongSelf) return;
84
+ auto eventEmitter = std::static_pointer_cast<const DaroRNNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
85
+ if (!eventEmitter) return;
86
+ std::vector<std::string> assetTypes;
87
+ for (NSString *value in DaroRNFabricEventBody(body)[@"assetTypes"]) {
88
+ assetTypes.push_back(std::string(value.UTF8String));
89
+ }
90
+ eventEmitter->onNativeAdAssetLoadedEvent({.assetTypes = assetTypes});
91
+ };
92
+
93
+ RCTDirectEventBlock onAdLoadedEvent = ^(NSDictionary *body) {
94
+ DaroRNNativeAdViewComponentView *strongSelf = weakSelf;
95
+ if (!strongSelf) {
96
+ return;
97
+ }
98
+
99
+ auto eventEmitter = std::static_pointer_cast<const DaroRNNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
100
+ if (!eventEmitter) {
101
+ return;
102
+ }
103
+
104
+ NSDictionary *eventBody = DaroRNFabricEventBody(body);
105
+ eventEmitter->onAdLoadedEvent({
106
+ .adUnitId = DaroRNFabricEventString(eventBody, @"adUnitId"),
107
+ .latencyMillis = DaroRNFabricEventDouble(eventBody, @"latencyMillis"),
108
+ // Fabric 이벤트는 타입 있는 구조체다 — **여기 안 적으면 네이티브가 보내도 JS 에 안 온다.**
109
+ // Android 는 맵을 통째로 넘겨서 안 걸린다. codegen 타입만 넓히면 부족하다.
110
+ .mediationPlatform = DaroRNFabricEventString(eventBody, @"mediationPlatform"),
111
+ .adNetwork = DaroRNFabricEventString(eventBody, @"adNetwork"),
112
+ });
113
+ };
114
+
115
+ RCTDirectEventBlock onAdLoadFailedEvent = ^(NSDictionary *body) {
116
+ DaroRNNativeAdViewComponentView *strongSelf = weakSelf;
117
+ if (!strongSelf) {
118
+ return;
119
+ }
120
+
121
+ auto eventEmitter = std::static_pointer_cast<const DaroRNNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
122
+ if (!eventEmitter) {
123
+ return;
124
+ }
125
+
126
+ NSDictionary *eventBody = DaroRNFabricEventBody(body);
127
+ eventEmitter->onAdLoadFailedEvent({
128
+ .adUnitId = DaroRNFabricEventString(eventBody, @"adUnitId"),
129
+ .code = DaroRNFabricEventInt(eventBody, @"code"),
130
+ .message = DaroRNFabricEventString(eventBody, @"message"),
131
+ .latencyMillis = DaroRNFabricEventDouble(eventBody, @"latencyMillis"),
132
+ });
133
+ };
134
+
135
+ RCTDirectEventBlock onAdClickedEvent = ^(NSDictionary *body) {
136
+ DaroRNNativeAdViewComponentView *strongSelf = weakSelf;
137
+ if (!strongSelf) {
138
+ return;
139
+ }
140
+
141
+ auto eventEmitter = std::static_pointer_cast<const DaroRNNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
142
+ if (!eventEmitter) {
143
+ return;
144
+ }
145
+
146
+ NSDictionary *eventBody = DaroRNFabricEventBody(body);
147
+ eventEmitter->onAdClickedEvent({
148
+ .adUnitId = DaroRNFabricEventString(eventBody, @"adUnitId"),
149
+ .latencyMillis = DaroRNFabricEventDouble(eventBody, @"latencyMillis"),
150
+ // Fabric 이벤트는 타입 있는 구조체다 — **여기 안 적으면 네이티브가 보내도 JS 에 안 온다.**
151
+ // Android 는 맵을 통째로 넘겨서 안 걸린다. codegen 타입만 넓히면 부족하다.
152
+ .mediationPlatform = DaroRNFabricEventString(eventBody, @"mediationPlatform"),
153
+ .adNetwork = DaroRNFabricEventString(eventBody, @"adNetwork"),
154
+ });
155
+ };
156
+
157
+ RCTDirectEventBlock onAdImpressionRecordedEvent = ^(NSDictionary *body) {
158
+ DaroRNNativeAdViewComponentView *strongSelf = weakSelf;
159
+ if (!strongSelf) {
160
+ return;
161
+ }
162
+
163
+ auto eventEmitter = std::static_pointer_cast<const DaroRNNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
164
+ if (!eventEmitter) {
165
+ return;
166
+ }
167
+
168
+ NSDictionary *eventBody = DaroRNFabricEventBody(body);
169
+ eventEmitter->onAdImpressionRecordedEvent({
170
+ .adUnitId = DaroRNFabricEventString(eventBody, @"adUnitId"),
171
+ .latencyMillis = DaroRNFabricEventDouble(eventBody, @"latencyMillis"),
172
+ // Fabric 이벤트는 타입 있는 구조체다 — **여기 안 적으면 네이티브가 보내도 JS 에 안 온다.**
173
+ // Android 는 맵을 통째로 넘겨서 안 걸린다. codegen 타입만 넓히면 부족하다.
174
+ .mediationPlatform = DaroRNFabricEventString(eventBody, @"mediationPlatform"),
175
+ .adNetwork = DaroRNFabricEventString(eventBody, @"adNetwork"),
176
+ });
177
+ };
178
+
179
+ DaroRNFabricSetValue(_nativeAdView, @"onNativeAdAssetLoadedEvent", onNativeAdAssetLoadedEvent);
180
+ DaroRNFabricSetValue(_nativeAdView, @"onAdLoadedEvent", onAdLoadedEvent);
181
+ DaroRNFabricSetValue(_nativeAdView, @"onAdLoadFailedEvent", onAdLoadFailedEvent);
182
+ DaroRNFabricSetValue(_nativeAdView, @"onAdClickedEvent", onAdClickedEvent);
183
+ DaroRNFabricSetValue(_nativeAdView, @"onAdImpressionRecordedEvent", onAdImpressionRecordedEvent);
184
+ }
185
+
186
+ + (ComponentDescriptorProvider)componentDescriptorProvider
187
+ {
188
+ return concreteComponentDescriptorProvider<DaroRNNativeAdViewComponentDescriptor>();
189
+ }
190
+
191
+ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
192
+ {
193
+ const auto &oldComponentProps = *std::static_pointer_cast<const DaroRNNativeAdViewProps>(_props);
194
+ const auto &newComponentProps = *std::static_pointer_cast<const DaroRNNativeAdViewProps>(props);
195
+ NSMutableArray<NSString *> *changedProps = [NSMutableArray new];
196
+
197
+ if (oldComponentProps.adUnitId != newComponentProps.adUnitId) {
198
+ DaroRNFabricSetValue(_nativeAdView, @"adUnitId", DaroRNFabricNSStringFromStdString(newComponentProps.adUnitId));
199
+ [changedProps addObject:@"adUnitId"];
200
+ }
201
+
202
+ if (oldComponentProps.loadOnMount != newComponentProps.loadOnMount) {
203
+ DaroRNFabricSetValue(_nativeAdView, @"loadOnMount", @(newComponentProps.loadOnMount));
204
+ [changedProps addObject:@"loadOnMount"];
205
+ }
206
+
207
+ if (oldComponentProps.adChoicesPosition != newComponentProps.adChoicesPosition) {
208
+ DaroRNFabricSetValue(
209
+ _nativeAdView, @"adChoicesPosition", DaroRNFabricAdChoicesPositionString(newComponentProps.adChoicesPosition));
210
+ [changedProps addObject:@"adChoicesPosition"];
211
+ }
212
+
213
+ if (oldComponentProps.titleView != newComponentProps.titleView) {
214
+ DaroRNFabricSetValue(_nativeAdView, @"titleView", @(newComponentProps.titleView));
215
+ [changedProps addObject:@"titleView"];
216
+ }
217
+
218
+ if (oldComponentProps.bodyView != newComponentProps.bodyView) {
219
+ DaroRNFabricSetValue(_nativeAdView, @"bodyView", @(newComponentProps.bodyView));
220
+ [changedProps addObject:@"bodyView"];
221
+ }
222
+
223
+ if (oldComponentProps.callToActionView != newComponentProps.callToActionView) {
224
+ DaroRNFabricSetValue(_nativeAdView, @"callToActionView", @(newComponentProps.callToActionView));
225
+ [changedProps addObject:@"callToActionView"];
226
+ }
227
+
228
+ if (oldComponentProps.iconView != newComponentProps.iconView) {
229
+ DaroRNFabricSetValue(_nativeAdView, @"iconView", @(newComponentProps.iconView));
230
+ [changedProps addObject:@"iconView"];
231
+ }
232
+
233
+ if (oldComponentProps.mediaView != newComponentProps.mediaView) {
234
+ DaroRNFabricSetValue(_nativeAdView, @"mediaView", @(newComponentProps.mediaView));
235
+ [changedProps addObject:@"mediaView"];
236
+ }
237
+
238
+ if (oldComponentProps.titleViewStyleProps != newComponentProps.titleViewStyleProps) {
239
+ DaroRNFabricSetValue(_nativeAdView, @"titleViewStyleProps", DaroRNFabricIdFromDynamic(newComponentProps.titleViewStyleProps));
240
+ [changedProps addObject:@"titleViewStyleProps"];
241
+ }
242
+
243
+ if (oldComponentProps.bodyViewStyleProps != newComponentProps.bodyViewStyleProps) {
244
+ DaroRNFabricSetValue(_nativeAdView, @"bodyViewStyleProps", DaroRNFabricIdFromDynamic(newComponentProps.bodyViewStyleProps));
245
+ [changedProps addObject:@"bodyViewStyleProps"];
246
+ }
247
+
248
+ if (oldComponentProps.callToActionViewStyleProps != newComponentProps.callToActionViewStyleProps) {
249
+ DaroRNFabricSetValue(
250
+ _nativeAdView, @"callToActionViewStyleProps", DaroRNFabricIdFromDynamic(newComponentProps.callToActionViewStyleProps));
251
+ [changedProps addObject:@"callToActionViewStyleProps"];
252
+ }
253
+
254
+ if (oldComponentProps.iconViewStyleProps != newComponentProps.iconViewStyleProps) {
255
+ DaroRNFabricSetValue(_nativeAdView, @"iconViewStyleProps", DaroRNFabricIdFromDynamic(newComponentProps.iconViewStyleProps));
256
+ [changedProps addObject:@"iconViewStyleProps"];
257
+ }
258
+
259
+ if (oldComponentProps.mediaViewStyleProps != newComponentProps.mediaViewStyleProps) {
260
+ DaroRNFabricSetValue(_nativeAdView, @"mediaViewStyleProps", DaroRNFabricIdFromDynamic(newComponentProps.mediaViewStyleProps));
261
+ [changedProps addObject:@"mediaViewStyleProps"];
262
+ }
263
+
264
+ [super updateProps:props oldProps:oldProps];
265
+
266
+ DaroRNFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"applyReactProps:"), changedProps);
267
+ }
268
+
269
+ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics
270
+ {
271
+ [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
272
+ _nativeAdView.frame = self.bounds;
273
+ }
274
+
275
+ - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
276
+ {
277
+ DaroRNFabricPerformSelectorWithTwoObjects(
278
+ _nativeAdView, NSSelectorFromString(@"insertMountedSubview:atIndex:"), childComponentView, @(index));
279
+ }
280
+
281
+ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
282
+ {
283
+ [childComponentView removeFromSuperview];
284
+ DaroRNFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"refreshMountedAssetViews"));
285
+ }
286
+
287
+ - (void)loadAd
288
+ {
289
+ DaroRNFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"loadAd"));
290
+ }
291
+
292
+ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
293
+ {
294
+ RCTDaroRNNativeAdViewHandleCommand(self, commandName, args);
295
+ }
296
+
297
+ - (void)prepareForRecycle
298
+ {
299
+ [super prepareForRecycle];
300
+ DaroRNFabricSetValue(_nativeAdView, @"onNativeAdAssetLoadedEvent", nil);
301
+ DaroRNFabricSetValue(_nativeAdView, @"onAdLoadedEvent", nil);
302
+ DaroRNFabricSetValue(_nativeAdView, @"onAdLoadFailedEvent", nil);
303
+ DaroRNFabricSetValue(_nativeAdView, @"onAdClickedEvent", nil);
304
+ DaroRNFabricSetValue(_nativeAdView, @"onAdImpressionRecordedEvent", nil);
305
+ DaroRNFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), nil);
306
+ DaroRNFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"prepareForReuse"));
307
+ DaroRNFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), _nativeAdView);
308
+ [self installEventHandlers];
309
+ static const auto defaultProps = std::make_shared<const DaroRNNativeAdViewProps>();
310
+ _props = defaultProps;
311
+ }
312
+
313
+ @end
314
+
315
+ Class<RCTComponentViewProtocol> DaroRNNativeAdViewCls(void)
316
+ {
317
+ return DaroRNNativeAdViewComponentView.class;
318
+ }
319
+
320
+ #endif
@@ -1,6 +1,6 @@
1
1
  #import <React/RCTViewManager.h>
2
2
 
3
- @interface RCT_EXTERN_MODULE(DaroMAdBannerViewManager, RCTViewManager)
3
+ @interface RCT_EXTERN_MODULE(DaroRNAdBannerViewManager, RCTViewManager)
4
4
 
5
5
  RCT_EXPORT_VIEW_PROPERTY(adUnitId, NSString)
6
6
  RCT_EXPORT_VIEW_PROPERTY(adFormat, NSString)
@@ -1,9 +1,9 @@
1
1
  import React
2
2
 
3
- @objc(DaroMAdBannerViewManager)
4
- class DaroMAdBannerViewManager: RCTViewManager {
5
- override func view() -> DaroMAdBannerView {
6
- DaroMAdBannerView()
3
+ @objc(DaroRNAdBannerViewManager)
4
+ class DaroRNAdBannerViewManager: RCTViewManager {
5
+ override func view() -> DaroRNAdBannerView {
6
+ DaroRNAdBannerView()
7
7
  }
8
8
 
9
9
  @objc override static func requiresMainQueueSetup() -> Bool {
@@ -13,7 +13,7 @@ class DaroMAdBannerViewManager: RCTViewManager {
13
13
  @objc(loadAd:)
14
14
  func loadAd(viewTag: NSNumber) {
15
15
  bridge?.uiManager.addUIBlock({ _, viewRegistry in
16
- if let view = viewRegistry?[viewTag] as? DaroMAdBannerView {
16
+ if let view = viewRegistry?[viewTag] as? DaroRNAdBannerView {
17
17
  view.loadAd()
18
18
  }
19
19
  })
@@ -1,6 +1,6 @@
1
1
  #import <React/RCTViewManager.h>
2
2
 
3
- @interface RCT_EXTERN_MODULE (DaroMNativeAdViewManager, RCTViewManager)
3
+ @interface RCT_EXTERN_MODULE (DaroRNNativeAdViewManager, RCTViewManager)
4
4
 
5
5
  RCT_EXPORT_VIEW_PROPERTY(adUnitId, NSString)
6
6
  RCT_EXPORT_VIEW_PROPERTY(loadOnMount, BOOL)
@@ -18,6 +18,7 @@ RCT_EXPORT_VIEW_PROPERTY(callToActionViewStyleProps, NSDictionary)
18
18
  RCT_EXPORT_VIEW_PROPERTY(iconViewStyleProps, NSDictionary)
19
19
  RCT_EXPORT_VIEW_PROPERTY(mediaViewStyleProps, NSDictionary)
20
20
 
21
+ RCT_EXPORT_VIEW_PROPERTY(onNativeAdAssetLoadedEvent, RCTDirectEventBlock)
21
22
  RCT_EXPORT_VIEW_PROPERTY(onAdLoadedEvent, RCTDirectEventBlock)
22
23
  RCT_EXPORT_VIEW_PROPERTY(onAdLoadFailedEvent, RCTDirectEventBlock)
23
24
  RCT_EXPORT_VIEW_PROPERTY(onAdClickedEvent, RCTDirectEventBlock)
@@ -0,0 +1,22 @@
1
+ import React
2
+ import UIKit
3
+
4
+ @objc(DaroRNNativeAdViewManager)
5
+ class DaroRNNativeAdViewManager: RCTViewManager {
6
+ override func view() -> RNDaroRNNativeAdView {
7
+ RNDaroRNNativeAdView(assetResolver: DaroRNBridgeNativeAssetResolver(bridge: bridge))
8
+ }
9
+
10
+ @objc override static func requiresMainQueueSetup() -> Bool {
11
+ false
12
+ }
13
+
14
+ @objc(loadAd:)
15
+ func loadAd(viewTag: NSNumber) {
16
+ bridge?.uiManager.addUIBlock({ _, viewRegistry in
17
+ if let view = viewRegistry?[viewTag] as? RNDaroRNNativeAdView {
18
+ view.loadAd()
19
+ }
20
+ })
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ import Dispatch
2
+ import GoogleMobileAds
3
+
4
+ // 통합 Daro 바이너리에는 미디에이션 디버거 API 가 없다 — Android 의
5
+ // droom.daro.sdk.Daro.openDebugger 에 대응하는 심볼이 iOS 에는 아직 없다(DARO-1390).
6
+ // 그때까지 AdMob Ad Inspector 를 직접 연다. SDK 에 대응이 생기면 이 파일을 교체한다.
7
+ enum DaroMediationDebugger {
8
+ static func show(resolve: @escaping () -> Void) {
9
+ DispatchQueue.main.async {
10
+ MobileAds.shared.presentAdInspector(from: nil) { _ in }
11
+ resolve()
12
+ }
13
+ }
14
+ }
@@ -1,6 +1,7 @@
1
1
  import React
2
2
 
3
- final class DaroMAdEventSink {
3
+ final class DaroRNAdEventSink {
4
+ var onNativeAdAssetLoadedEvent: RCTDirectEventBlock?
4
5
  var onAdLoadedEvent: RCTDirectEventBlock?
5
6
  var onAdLoadFailedEvent: RCTDirectEventBlock?
6
7
  var onAdClickedEvent: RCTDirectEventBlock?
@@ -1,21 +1,21 @@
1
1
  import React
2
2
  import UIKit
3
3
 
4
- private enum DaroMBannerLoadRequest: Equatable {
4
+ private enum DaroRNBannerLoadRequest: Equatable {
5
5
  case automatic
6
6
  case explicit
7
7
  }
8
8
 
9
- @objc(DaroMAdBannerView)
10
- final class DaroMAdBannerView: UIView {
9
+ @objc(DaroRNAdBannerView)
10
+ final class DaroRNAdBannerView: UIView {
11
11
 
12
12
  var adBannerView: DaroAdBannerView?
13
- private let eventSink = DaroMAdEventSink()
13
+ private let eventSink = DaroRNAdEventSink()
14
14
  private var hasRequestedInitialLoad = false
15
- private var pendingLoadRequest: DaroMBannerLoadRequest?
15
+ private var pendingLoadRequest: DaroRNBannerLoadRequest?
16
16
 
17
17
  @objc var adUnitId: String?
18
- @objc var adFormat: String = DaroMModule.Constants.bannerAdFormatLabel.value
18
+ @objc var adFormat: String = DaroRNModule.Constants.bannerAdFormatLabel.value
19
19
  @objc var loadOnMount: Bool = true
20
20
  @objc var isVisible: Bool = true {
21
21
  didSet {
@@ -57,7 +57,7 @@ final class DaroMAdBannerView: UIView {
57
57
  guard let changedProps, changedProps.isEmpty == false else { return }
58
58
  guard let adUnitId, adUnitId.isEmpty == false else {
59
59
  if changedProps.contains("adUnitId") {
60
- DaroMModule.logger.warning("AdUnitId is required")
60
+ DaroRNModule.logger.warning("AdUnitId is required")
61
61
  }
62
62
  return
63
63
  }
@@ -75,13 +75,13 @@ final class DaroMAdBannerView: UIView {
75
75
  func prepareForReuse() {
76
76
  resetAdState()
77
77
  adUnitId = nil
78
- adFormat = DaroMModule.Constants.bannerAdFormatLabel.value
78
+ adFormat = DaroRNModule.Constants.bannerAdFormatLabel.value
79
79
  loadOnMount = true
80
80
  isVisible = true
81
81
  isHidden = false
82
82
  }
83
83
 
84
- private func requestLoad(_ request: DaroMBannerLoadRequest) {
84
+ private func requestLoad(_ request: DaroRNBannerLoadRequest) {
85
85
  initialize()
86
86
 
87
87
  guard let adBannerView else { return }
@@ -101,11 +101,11 @@ final class DaroMAdBannerView: UIView {
101
101
  return
102
102
  }
103
103
  guard let adUnitId, adUnitId.isEmpty == false else {
104
- DaroMModule.logger.warning("AdUnitId is required")
104
+ DaroRNModule.logger.warning("AdUnitId is required")
105
105
  return
106
106
  }
107
107
 
108
- let bannerSize = adFormat == DaroMModule.Constants.bannerAdFormatLabel.value ? DaroAdBannerSize.banner : DaroAdBannerSize.MREC
108
+ let bannerSize = adFormat == DaroRNModule.Constants.bannerAdFormatLabel.value ? DaroAdBannerSize.banner : DaroAdBannerSize.MREC
109
109
  let adUnit = DaroAdUnit(unitId: adUnitId)
110
110
  let adBannerView = DaroAdBannerView(unit: adUnit, bannerSize: bannerSize, autoLoad: false)
111
111
  setupBannerListener(for: adBannerView)
@@ -1,12 +1,12 @@
1
1
  import Foundation
2
2
 
3
- enum DaroMNativeAdLoadRequest: Equatable {
3
+ enum DaroRNNativeAdLoadRequest: Equatable {
4
4
  case automatic
5
5
  case explicit
6
6
  }
7
7
 
8
- final class DaroMNativeAdLoadCoordinator {
9
- private var pendingRequest: DaroMNativeAdLoadRequest?
8
+ final class DaroRNNativeAdLoadCoordinator {
9
+ private var pendingRequest: DaroRNNativeAdLoadRequest?
10
10
  private var hasConsumedInitialLoad = false
11
11
 
12
12
  var hasPendingLoad: Bool {
@@ -27,7 +27,7 @@ final class DaroMNativeAdLoadCoordinator {
27
27
  pendingRequest = nil
28
28
  }
29
29
 
30
- func consumePendingLoad(loadOnMount: Bool) -> DaroMNativeAdLoadRequest? {
30
+ func consumePendingLoad(loadOnMount: Bool) -> DaroRNNativeAdLoadRequest? {
31
31
  guard let pendingRequest else { return nil }
32
32
 
33
33
  if pendingRequest == .automatic {
@@ -1,19 +1,19 @@
1
1
  import React
2
2
  import UIKit
3
3
 
4
- @objc(RNDaroMNativeAdView)
5
- final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
4
+ @objc(RNDaroRNNativeAdView)
5
+ final class RNDaroRNNativeAdView: UIView, DaroRNNativeAdRenderDelegate {
6
6
 
7
7
  private static let assetLoadRetryDelay: TimeInterval = 0.05
8
8
  private static let maxAssetLoadRetryCount = 40
9
9
 
10
- var _internalAdView: DaroMBridgeNativeAdView?
10
+ var _internalAdView: DaroRNBridgeNativeAdView?
11
11
  private var pinnedConstraints: [ObjectIdentifier: [NSLayoutConstraint]] = [:]
12
12
  private var pendingLoadWorkItem: DispatchWorkItem?
13
- private let loadCoordinator = DaroMNativeAdLoadCoordinator()
14
- private var defaultAssetResolver: DaroMNativeAssetResolving?
15
- private var assetResolver: DaroMNativeAssetResolving?
16
- private let eventSink = DaroMAdEventSink()
13
+ private let loadCoordinator = DaroRNNativeAdLoadCoordinator()
14
+ private var defaultAssetResolver: DaroRNNativeAssetResolving?
15
+ private var assetResolver: DaroRNNativeAssetResolving?
16
+ private let eventSink = DaroRNAdEventSink()
17
17
  var adUnit: DaroAdUnit
18
18
 
19
19
  @objc var adUnitId: String?
@@ -70,11 +70,11 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
70
70
  }
71
71
  @objc var adChoicesPosition: String?
72
72
 
73
- var _internalTitleLabel: UILabel = RNDaroMNativeAdView.makeTitleLabel()
74
- var _internalBodyLabel: UILabel = RNDaroMNativeAdView.makeBodyLabel()
75
- var _internalMediaView: UIView = RNDaroMNativeAdView.makeMediaView()
76
- var _internalIconImageView: UIImageView = RNDaroMNativeAdView.makeIconImageView()
77
- var _internalFakeCTAButton: UIButton = RNDaroMNativeAdView.makeFakeCTAButton()
73
+ var _internalTitleLabel: UILabel = RNDaroRNNativeAdView.makeTitleLabel()
74
+ var _internalBodyLabel: UILabel = RNDaroRNNativeAdView.makeBodyLabel()
75
+ var _internalMediaView: UIView = RNDaroRNNativeAdView.makeMediaView()
76
+ var _internalIconImageView: UIImageView = RNDaroRNNativeAdView.makeIconImageView()
77
+ var _internalFakeCTAButton: UIButton = RNDaroRNNativeAdView.makeFakeCTAButton()
78
78
 
79
79
  private static func makeTitleLabel() -> UILabel {
80
80
  let label = UILabel()
@@ -112,6 +112,10 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
112
112
  return button
113
113
  }
114
114
 
115
+ @objc var onNativeAdAssetLoadedEvent: RCTDirectEventBlock? {
116
+ get { eventSink.onNativeAdAssetLoadedEvent }
117
+ set { eventSink.onNativeAdAssetLoadedEvent = newValue }
118
+ }
115
119
  @objc var onAdLoadedEvent: RCTDirectEventBlock? {
116
120
  get { eventSink.onAdLoadedEvent }
117
121
  set { eventSink.onAdLoadedEvent = newValue }
@@ -138,7 +142,7 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
138
142
  return tag
139
143
  }
140
144
 
141
- convenience init(assetResolver: DaroMNativeAssetResolving?) {
145
+ convenience init(assetResolver: DaroRNNativeAssetResolving?) {
142
146
  self.init()
143
147
  self.defaultAssetResolver = assetResolver
144
148
  self.assetResolver = assetResolver
@@ -167,12 +171,12 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
167
171
  guard changedProps.isEmpty == false else { return }
168
172
  guard let adUnitId, adUnitId.isEmpty == false else {
169
173
  if changedProps.contains("adUnitId") {
170
- DaroMModule.logger.warning("[native-ad] AdUnitId is required")
174
+ DaroRNModule.logger.warning("[native-ad] AdUnitId is required")
171
175
  }
172
176
  return
173
177
  }
174
178
  loadCoordinator.cancelAutomaticLoadIfNeeded(loadOnMount: loadOnMount)
175
- DaroMModule.logger.info("[native-ad] \(#function): \(changedProps)")
179
+ DaroRNModule.logger.info("[native-ad] \(#function): \(changedProps)")
176
180
  if !isAdUnitIdSet {
177
181
  isAdUnitIdSet = true
178
182
  makeAdViews(unitId: adUnitId)
@@ -244,7 +248,7 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
244
248
 
245
249
  private func retryPendingLoad(retryCount: Int) {
246
250
  guard retryCount < Self.maxAssetLoadRetryCount else {
247
- DaroMModule.logger.warning("[native-ad] Asset views were not ready before load request")
251
+ DaroRNModule.logger.warning("[native-ad] Asset views were not ready before load request")
248
252
  pendingLoadWorkItem = nil
249
253
  return
250
254
  }
@@ -284,7 +288,7 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
284
288
 
285
289
  private func makeAdViews(unitId: String) {
286
290
  self.adUnit = DaroAdUnit(unitId: unitId)
287
- let native = DaroMBridgeNativeAdView(
291
+ let native = DaroRNBridgeNativeAdView(
288
292
  unit: adUnit,
289
293
  preferredAdChoicesPosition: preferredAdChoicesPosition
290
294
  )
@@ -299,6 +303,9 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
299
303
  }
300
304
  pin(native, to: self)
301
305
 
306
+ self._internalAdView?.listener.onNativeAdAssetLoaded = { [weak self] assetTypes in
307
+ self?.eventSink.onNativeAdAssetLoadedEvent?(["assetTypes": assetTypes.map(\.rawValue)])
308
+ }
302
309
  self._internalAdView?.listener.onAdLoadSuccess = { [weak self] _, adInfo in
303
310
  self?.eventSink.emitAdLoaded(adInfo?.toBody)
304
311
  }
@@ -375,7 +382,7 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
375
382
  @objc(setAssetSearchRootView:)
376
383
  func setAssetSearchRootView(_ rootView: UIView?) {
377
384
  if let rootView {
378
- assetResolver = DaroMDescendantNativeAssetResolver(rootView: rootView)
385
+ assetResolver = DaroRNDescendantNativeAssetResolver(rootView: rootView)
379
386
  } else {
380
387
  assetResolver = defaultAssetResolver
381
388
  }
@@ -504,6 +511,7 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
504
511
  pinnedConstraints.values.forEach { NSLayoutConstraint.deactivate($0) }
505
512
  pinnedConstraints.removeAll()
506
513
 
514
+ _internalAdView?.listener.onNativeAdAssetLoaded = nil
507
515
  _internalAdView?.listener.onAdLoadSuccess = nil
508
516
  _internalAdView?.listener.onAdLoadFail = nil
509
517
  _internalAdView?.listener.onAdImpression = nil
@@ -538,12 +546,12 @@ final class RNDaroMNativeAdView: UIView, DaroMNativeAdRenderDelegate {
538
546
  }
539
547
  }
540
548
 
541
- protocol DaroMNativeAdRenderDelegate: AnyObject {
549
+ protocol DaroRNNativeAdRenderDelegate: AnyObject {
542
550
  func renderAd(for nativeAd: DaroAdNative)
543
551
  }
544
552
 
545
- class DaroMBridgeNativeAdView: DaroAdNativeView {
546
- weak var delegate: DaroMNativeAdRenderDelegate?
553
+ class DaroRNBridgeNativeAdView: DaroAdNativeView {
554
+ weak var delegate: DaroRNNativeAdRenderDelegate?
547
555
 
548
556
  override func renderAd(for nativeAd: DaroAdNative, loader: any AdNativeLoadable) {
549
557
  super.renderAd(for: nativeAd, loader: loader)