react-native-daro 1.0.13 → 1.0.15

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 (164) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +30 -30
  3. package/android/build.gradle +42 -59
  4. package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +23 -0
  5. package/android/src/main/AndroidManifest.xml +1 -2
  6. package/android/src/main/java/com/{darom → daro/reactnative}/DaroMAdBannerViewManager.kt +4 -4
  7. package/android/src/main/java/com/{darom → daro/reactnative}/DaroMAdNativeViewManager.kt +4 -4
  8. package/android/src/main/java/com/{darom → daro/reactnative}/DaroMModule.kt +44 -45
  9. package/android/src/main/java/com/{darom → daro/reactnative}/DaroMPackage.kt +1 -1
  10. package/android/src/main/java/com/{darom → daro/reactnative}/constants/InternalDaroMBannerSize.kt +1 -1
  11. package/android/src/main/java/com/{darom → daro/reactnative}/event/DaroMEvent.kt +1 -1
  12. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMBannerViewModuleImpl.kt +2 -2
  13. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMInterstitialModuleImpl.kt +26 -26
  14. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMLightPopupModuleImpl.kt +30 -29
  15. package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMRewardedAdModuleImpl.kt +27 -27
  16. package/android/src/main/java/com/{darom → daro/reactnative}/util/AdInfoUtil.kt +25 -1
  17. package/android/src/main/java/com/{darom → daro/reactnative}/util/EventEmitterUtil.kt +2 -2
  18. package/android/src/main/java/com/daro/reactnative/view/DaroMAdBannerViewContainer.kt +417 -0
  19. package/android/src/main/java/com/{darom → daro/reactnative}/view/DaroMAdNativeViewContainer.kt +4 -4
  20. package/app.plugin.js +1 -0
  21. package/ios/DaroMAdBannerViewManager.swift +1 -1
  22. package/ios/DaroMModule+AppOpen.swift +34 -31
  23. package/ios/DaroMModule+Interstitial.swift +29 -26
  24. package/ios/DaroMModule+LightPopup.swift +40 -33
  25. package/ios/DaroMModule+Rewarded.swift +35 -27
  26. package/ios/DaroMModule.mm +13 -13
  27. package/ios/DaroMModule.swift +20 -13
  28. package/ios/DaroMNativeAdViewManager.swift +1 -1
  29. package/ios/mediation/admob/DaroMediationDebugger.swift +11 -0
  30. package/ios/mediation/admob/DaroMediationTypes.swift +22 -0
  31. package/lib/commonjs/AdBannerView.js +6 -1
  32. package/lib/commonjs/AdBannerView.js.map +1 -1
  33. package/lib/commonjs/AppOpenAd.js +43 -17
  34. package/lib/commonjs/AppOpenAd.js.map +1 -1
  35. package/lib/commonjs/ErrorCode.js.map +1 -1
  36. package/lib/commonjs/EventEmitter.js.map +1 -1
  37. package/lib/commonjs/InterstitialAd.js +45 -17
  38. package/lib/commonjs/InterstitialAd.js.map +1 -1
  39. package/lib/commonjs/LightPopupAd.js +62 -43
  40. package/lib/commonjs/LightPopupAd.js.map +1 -1
  41. package/lib/commonjs/RewardedAd.js +44 -18
  42. package/lib/commonjs/RewardedAd.js.map +1 -1
  43. package/lib/commonjs/index.js +1 -1
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/nativeAd/NativeAdView.js +5 -1
  46. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  47. package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
  48. package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
  49. package/lib/commonjs/package.json +1 -0
  50. package/lib/module/AdBannerView.js +6 -1
  51. package/lib/module/AdBannerView.js.map +1 -1
  52. package/lib/module/AppOpenAd.js +43 -17
  53. package/lib/module/AppOpenAd.js.map +1 -1
  54. package/lib/module/ErrorCode.js.map +1 -1
  55. package/lib/module/EventEmitter.js.map +1 -1
  56. package/lib/module/InterstitialAd.js +45 -17
  57. package/lib/module/InterstitialAd.js.map +1 -1
  58. package/lib/module/LightPopupAd.js +63 -43
  59. package/lib/module/LightPopupAd.js.map +1 -1
  60. package/lib/module/RewardedAd.js +44 -18
  61. package/lib/module/RewardedAd.js.map +1 -1
  62. package/lib/module/index.js +1 -1
  63. package/lib/module/index.js.map +1 -1
  64. package/lib/module/nativeAd/NativeAdView.js +5 -1
  65. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  66. package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
  67. package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
  68. package/lib/module/package.json +1 -0
  69. package/lib/typescript/commonjs/plugin/src/index.d.ts +19 -0
  70. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  71. package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts +6 -0
  72. package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts.map +1 -0
  73. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +8 -0
  74. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/plugin/src/withIos.d.ts +8 -0
  76. package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/src/AdBannerView.d.ts +124 -2
  78. package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/AppOpenAd.d.ts +6 -0
  80. package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/ErrorCode.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/EventEmitter.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/InterstitialAd.d.ts +6 -0
  84. package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/LightPopupAd.d.ts +6 -0
  86. package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/RewardedAd.d.ts +6 -0
  88. package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +124 -2
  90. package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts +2 -2
  94. package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/types/AdProps.d.ts +2 -2
  97. package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
  100. package/lib/typescript/module/plugin/src/index.d.ts +19 -0
  101. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  102. package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts +6 -0
  103. package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts.map +1 -0
  104. package/lib/typescript/module/plugin/src/withAndroid.d.ts +8 -0
  105. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  106. package/lib/typescript/module/plugin/src/withIos.d.ts +8 -0
  107. package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -0
  108. package/lib/typescript/module/src/AdBannerView.d.ts +124 -2
  109. package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
  110. package/lib/typescript/module/src/AppOpenAd.d.ts +6 -0
  111. package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
  112. package/lib/typescript/module/src/ErrorCode.d.ts.map +1 -1
  113. package/lib/typescript/module/src/EventEmitter.d.ts.map +1 -1
  114. package/lib/typescript/module/src/InterstitialAd.d.ts +6 -0
  115. package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
  116. package/lib/typescript/module/src/LightPopupAd.d.ts +6 -0
  117. package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
  118. package/lib/typescript/module/src/RewardedAd.d.ts +6 -0
  119. package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
  120. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +124 -2
  121. package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
  122. package/lib/typescript/module/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  123. package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  124. package/lib/typescript/module/src/types/AdBannerViewProps.d.ts +2 -2
  125. package/lib/typescript/module/src/types/AdBannerViewProps.d.ts.map +1 -1
  126. package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
  127. package/lib/typescript/module/src/types/AdProps.d.ts +2 -2
  128. package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
  129. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +1 -1
  130. package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
  131. package/package.json +88 -105
  132. package/plugin/build/index.d.ts +18 -0
  133. package/plugin/build/index.js +71 -0
  134. package/plugin/build/skAdNetworkIds.d.ts +5 -0
  135. package/plugin/build/skAdNetworkIds.js +205 -0
  136. package/plugin/build/withAndroid.d.ts +7 -0
  137. package/plugin/build/withAndroid.js +140 -0
  138. package/plugin/build/withIos.d.ts +7 -0
  139. package/plugin/build/withIos.js +83 -0
  140. package/react-native-daro.podspec +25 -0
  141. package/src/AdBannerView.tsx +54 -17
  142. package/src/AppOpenAd.ts +59 -15
  143. package/src/ErrorCode.ts +1 -2
  144. package/src/EventEmitter.ts +5 -2
  145. package/src/InterstitialAd.ts +73 -17
  146. package/src/LightPopupAd.ts +86 -46
  147. package/src/RewardedAd.ts +70 -18
  148. package/src/index.tsx +1 -1
  149. package/src/nativeAd/NativeAdView.tsx +65 -14
  150. package/src/nativeAd/NativeAdViewComponents.tsx +54 -27
  151. package/src/nativeAd/NativeAdViewProvider.tsx +17 -7
  152. package/src/types/AdBannerViewProps.ts +11 -11
  153. package/src/types/AdInfo.ts +17 -17
  154. package/src/types/AdProps.ts +8 -9
  155. package/src/types/DaroMMobileAds.ts +3 -6
  156. package/src/types/NativeAdViewProps.ts +5 -5
  157. package/src/types/index.ts +1 -1
  158. package/android/gradle.properties +0 -5
  159. package/android/src/main/AndroidManifestNew.xml +0 -7
  160. package/android/src/main/java/com/darom/view/DaroMAdBannerViewContainer.kt +0 -163
  161. package/android/src/main/res/layout/layout_activity_transparent.xml +0 -7
  162. package/android/src/main/res/values/styles.xml +0 -11
  163. package/ios/DaroM-Bridging-Header.h +0 -6
  164. package/react-native-daro-m.podspec +0 -44
@@ -4,15 +4,15 @@ import type { AdProps } from './AdProps';
4
4
  * A handler of {@link NativeAdView}.
5
5
  */
6
6
  export type NativeAdViewHandler = {
7
- /**
8
- * Loads a native ad.
9
- */
10
- loadAd(): void;
7
+ /**
8
+ * Loads a native ad.
9
+ */
10
+ loadAd(): void;
11
11
  };
12
12
 
13
13
  /**
14
14
  * Represents a {@link NativeAdView}.
15
15
  */
16
16
  export type NativeAdViewProps = AdProps & {
17
- loadOnMount?: boolean;
17
+ loadOnMount?: boolean;
18
18
  };
@@ -2,4 +2,4 @@ export * from './AdInfo';
2
2
  export * from './NativeAdViewProps';
3
3
  export * from './AdBannerViewProps';
4
4
  export * from './AdEvent';
5
- export * from './AdProps';
5
+ export * from './AdProps';
@@ -1,5 +0,0 @@
1
- DaroM_kotlinVersion=2.0.21
2
- DaroM_minSdkVersion=23
3
- DaroM_targetSdkVersion=34
4
- DaroM_compileSdkVersion=35
5
- DaroM_ndkversion=21.4.7075529
@@ -1,7 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- <application>
3
- <activity
4
- android:name=".cheat.DummyActivity"
5
- android:theme="@style/Theme.TransparentActivity" />
6
- </application>
7
- </manifest>
@@ -1,163 +0,0 @@
1
- package com.darom.view
2
-
3
- import android.annotation.SuppressLint
4
- import android.view.View
5
- import androidx.core.view.children
6
- import androidx.core.view.isVisible
7
- import com.darom.event.AdViewEvent
8
- import com.darom.util.AdInfoUtil
9
- import com.darom.util.EventEmitterUtil.sendNativeViewEvent
10
- import com.facebook.react.bridge.ReactContext
11
- import com.facebook.react.views.view.ReactViewGroup
12
- import droom.daro.core.adunit.DaroBannerAdUnit
13
- import droom.daro.core.model.DaroAdInfo
14
- import droom.daro.core.model.DaroAdLoadError
15
- import droom.daro.core.model.DaroBannerSize
16
- import droom.daro.core.model.DaroViewAd
17
- import droom.daro.view.DaroAdViewListener
18
- import droom.daro.view.DaroBannerAdView
19
-
20
- @SuppressLint("ViewConstructor")
21
- class DaroMAdBannerViewContainer(val context: ReactContext) : ReactViewGroup(context),
22
- DaroAdViewListener {
23
-
24
- private var adView: DaroBannerAdView? = null
25
-
26
- internal var adUnitId: String = ""
27
-
28
- internal var adSize: DaroBannerSize? = null
29
-
30
- internal var loadOnMount: Boolean = true
31
-
32
- private var isVisible: Boolean = true
33
- private var isAdPaused: Boolean = false
34
-
35
- fun loadAd() {
36
- (adView ?: buildAdView())?.apply {
37
- adView = this
38
-
39
- if (this.parent == null) {
40
- this@DaroMAdBannerViewContainer.addView(this)
41
- }
42
-
43
- loadAd()
44
- }
45
- }
46
-
47
- private fun buildAdView(): DaroBannerAdView? {
48
- if (adUnitId.isEmpty() || adSize == null) {
49
- return null
50
- }
51
-
52
- return DaroBannerAdView(
53
- context,
54
- DaroBannerAdUnit(
55
- key = adUnitId,
56
- placement = adUnitId,
57
- bannerSize = adSize!!,
58
- )
59
- ).also { view ->
60
- view.setListener(this)
61
- }
62
- }
63
-
64
- fun destroy() {
65
- adView?.destroy()
66
- }
67
-
68
- fun setAdVisibility(visible: Boolean) {
69
- isVisible = visible
70
- this.isVisible = visible
71
- adView?.isVisible = visible
72
-
73
- if (visible) {
74
- resumeAd()
75
- } else {
76
- pauseAd()
77
- }
78
- }
79
-
80
- fun pauseAd() {
81
- if (!isAdPaused) {
82
- isAdPaused = true
83
- adView?.pause()
84
- }
85
- }
86
-
87
- fun resumeAd() {
88
- if (isAdPaused) {
89
- isAdPaused = false
90
- adView?.resume()
91
- }
92
- }
93
-
94
- override fun onAdClicked(adInfo: DaroAdInfo) {
95
- sendNativeViewEvent(
96
- reactContext = context,
97
- event = AdViewEvent.ON_AD_CLICKED,
98
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo)
99
- )
100
- }
101
-
102
- override fun onAdImpression(adInfo: DaroAdInfo) {
103
- sendNativeViewEvent(
104
- reactContext = context,
105
- event = AdViewEvent.ON_AD_IMPRESSION,
106
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo),
107
- )
108
- }
109
-
110
- override fun onAdLoadFail(err: DaroAdLoadError) {
111
- sendNativeViewEvent(
112
- reactContext = context,
113
- event = AdViewEvent.ON_AD_FAILED_TO_LOAD,
114
- params = AdInfoUtil.getAdLoadFailedInfo(adUnitId, err),
115
- )
116
- }
117
-
118
- override fun onAdLoadSuccess(
119
- ad: DaroViewAd,
120
- adInfo: DaroAdInfo,
121
- ) {
122
- sendNativeViewEvent(
123
- reactContext = context,
124
- event = AdViewEvent.ON_AD_LOADED,
125
- params = AdInfoUtil.getAdInfo(adUnitId, adInfo),
126
- )
127
-
128
- adView?.children?.first()?.let {
129
- it.measure(
130
- MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
131
- MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
132
- )
133
-
134
- it.layout(0, 0, width, height)
135
- it.requestLayout()
136
- adView!!.requestLayout()
137
- }
138
- }
139
-
140
- override fun requestLayout() {
141
- super.requestLayout()
142
-
143
- // https://stackoverflow.com/a/39838774/5477988
144
- // This is required to ensure ad refreshes render correctly in RN Android due to known issue
145
- // where `getWidth()` and `getHeight()` return 0 on attach
146
- try {
147
- adView?.measure(
148
- MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
149
- MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
150
- )
151
-
152
- adView?.layout(0, 0, width, height)
153
- } catch (_: Exception) {
154
- // Ignore
155
- }
156
- }
157
-
158
- fun onSetProps() {
159
- if (loadOnMount) {
160
- loadAd()
161
- }
162
- }
163
- }
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <LinearLayout
3
- xmlns:android="http://schemas.android.com/apk/res/android"
4
- android:layout_width="match_parent"
5
- android:layout_height="match_parent"
6
- android:orientation="vertical">
7
- </LinearLayout>
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <resources>
3
- <style name="Theme.TransparentActivity" parent="Theme.AppCompat.NoActionBar">
4
- <item name="android:windowBackground">@android:color/transparent</item>
5
- <item name="android:windowIsTranslucent">true</item>
6
- <item name="android:windowNoTitle">true</item>
7
- <item name="android:statusBarColor">@android:color/transparent</item> <!-- 상태 바 투명 -->
8
- <item name="android:windowDrawsSystemBarBackgrounds">true</item>
9
- <item name="android:fitsSystemWindows">true</item>
10
- </style>
11
- </resources>
@@ -1,6 +0,0 @@
1
- #import <React/RCTViewManager.h>
2
- #import <React/RCTBridgeModule.h>
3
- #import <React/RCTEventEmitter.h>
4
- #import <React/RCTUIManager.h>
5
- #import <React/RCTImageView.h>
6
- #import <React/RCTTextView.h>
@@ -1,44 +0,0 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
-
6
- Pod::Spec.new do |s|
7
- s.name = "react-native-daro-m"
8
- s.version = package["version"]
9
- s.summary = package["description"]
10
- s.homepage = package["homepage"]
11
- s.license = package["license"]
12
- s.authors = package["author"]
13
-
14
- s.platforms = { :ios => "15.1" }
15
- s.source = { :git => "https://github.com/delightroom/daro-m-react-native.git", :tag => "#{s.version}" }
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
- s.dependency "DaroAds", "1.1.59"
20
-
21
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
23
- if respond_to?(:install_modules_dependencies, true)
24
- install_modules_dependencies(s)
25
- else
26
- s.dependency "React-Core"
27
-
28
- # Don't install the dependencies when we run `pod install` in the old architecture.
29
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
30
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
31
- s.pod_target_xcconfig = {
32
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
33
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
34
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
35
- }
36
- s.dependency "React-RCTFabric"
37
- s.dependency "React-Codegen"
38
- s.dependency "RCT-Folly"
39
- s.dependency "RCTRequired"
40
- s.dependency "RCTTypeSafety"
41
- s.dependency "ReactCommon/turbomodule/core"
42
- end
43
- end
44
- end