react-native-daro 1.0.16 → 2.0.0-rc.1

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 (146) hide show
  1. package/README.md +2 -5
  2. package/android/build.gradle +6 -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 +376 -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} +6 -6
  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/{DaroMLightPopupModuleImpl.kt → DaroRNLightPopupModuleImpl.kt} +4 -4
  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/util/AdInfoUtil.kt +12 -0
  15. package/android/src/main/java/com/daro/reactnative/util/DaroQaProbe.kt +147 -0
  16. package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +2 -2
  17. package/android/src/main/java/com/daro/reactnative/view/{DaroMAdBannerViewContainer.kt → DaroRNAdBannerViewContainer.kt} +2 -3
  18. package/android/src/main/java/com/daro/reactnative/view/{DaroMAdNativeViewContainer.kt → DaroRNAdNativeViewContainer.kt} +3 -4
  19. package/android/src/newarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +1 -1
  20. package/android/src/oldarch/java/com/daro/reactnative/{DaroMModuleSpec.kt → DaroRNModuleSpec.kt} +32 -3
  21. package/ios/{DaroMModule+AppOpen.swift → DaroRNModule+AppOpen.swift} +10 -11
  22. package/ios/DaroRNModule+Consent.swift +88 -0
  23. package/ios/{DaroMModule+Interstitial.swift → DaroRNModule+Interstitial.swift} +9 -9
  24. package/ios/{DaroMModule+LightPopup.swift → DaroRNModule+LightPopup.swift} +2 -2
  25. package/ios/DaroRNModule+Qa.swift +158 -0
  26. package/ios/{DaroMModule+Rewarded.swift → DaroRNModule+Rewarded.swift} +10 -10
  27. package/ios/{DaroMModule.mm → DaroRNModule.mm} +19 -4
  28. package/ios/{DaroMModule.swift → DaroRNModule.swift} +20 -6
  29. package/ios/Fabric/DaroRNAdBannerComponentView.mm +219 -0
  30. package/ios/Fabric/{DaroMFabricEventSink.mm → DaroRNFabricEventSink.mm} +4 -4
  31. package/ios/Fabric/{DaroMFabricPropApplier.mm → DaroRNFabricPropApplier.mm} +14 -14
  32. package/ios/Fabric/DaroRNNativeAdComponentView.mm +306 -0
  33. package/ios/Paper/{DaroMAdBannerViewManager.m → DaroRNAdBannerViewManager.m} +1 -1
  34. package/ios/Paper/{DaroMAdBannerViewManager.swift → DaroRNAdBannerViewManager.swift} +5 -5
  35. package/ios/Paper/{DaroMNativeAdViewManager.m → DaroRNNativeAdViewManager.m} +1 -1
  36. package/ios/Paper/DaroRNNativeAdViewManager.swift +22 -0
  37. package/ios/Shared/DaroMediationDebugger.swift +14 -0
  38. package/ios/Shared/{DaroMAdEventSink.swift → DaroRNAdEventSink.swift} +1 -1
  39. package/ios/Shared/{DaroMBannerAdView.swift → DaroRNBannerAdView.swift} +11 -11
  40. package/ios/Shared/{DaroMNativeAdLoadCoordinator.swift → DaroRNNativeAdLoadCoordinator.swift} +4 -4
  41. package/ios/Shared/{DaroMNativeAdView.swift → DaroRNNativeAdView.swift} +21 -21
  42. package/ios/Shared/{DaroMNativeAssetResolver.swift → DaroRNNativeAssetResolver.swift} +6 -6
  43. package/lib/commonjs/AdBannerView.js +3 -5
  44. package/lib/commonjs/AdBannerView.js.map +1 -1
  45. package/lib/commonjs/AppOpenAd.js +4 -4
  46. package/lib/commonjs/AppOpenAd.js.map +1 -1
  47. package/lib/commonjs/{DaroMAdBannerViewNativeComponent.ts → DaroRNAdBannerViewNativeComponent.ts} +5 -2
  48. package/{src/DaroMNativeAdViewNativeComponent.ts → lib/commonjs/DaroRNNativeAdViewNativeComponent.ts} +5 -2
  49. package/lib/commonjs/NativeDaroModule.js +1 -1
  50. package/lib/commonjs/NativeDaroModule.js.map +1 -1
  51. package/lib/commonjs/index.js +121 -0
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/nativeAd/NativeAdView.js +3 -3
  54. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  55. package/lib/module/AdBannerView.js +1 -3
  56. package/lib/module/AdBannerView.js.map +1 -1
  57. package/lib/module/AppOpenAd.js +4 -4
  58. package/lib/module/AppOpenAd.js.map +1 -1
  59. package/{src/DaroMAdBannerViewNativeComponent.ts → lib/module/DaroRNAdBannerViewNativeComponent.ts} +5 -2
  60. package/lib/{commonjs/DaroMNativeAdViewNativeComponent.ts → module/DaroRNNativeAdViewNativeComponent.ts} +5 -2
  61. package/lib/module/NativeDaroModule.js +1 -1
  62. package/lib/module/NativeDaroModule.js.map +1 -1
  63. package/lib/module/index.js +101 -0
  64. package/lib/module/index.js.map +1 -1
  65. package/lib/module/nativeAd/NativeAdView.js +1 -1
  66. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  67. package/lib/typescript/commonjs/plugin/src/index.d.ts +2 -6
  68. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +2 -6
  70. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/plugin/src/withIos.d.ts +2 -6
  72. package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/AppOpenAd.d.ts +2 -2
  75. package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
  77. package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +3 -2
  79. package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +10 -1
  81. package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/index.d.ts +79 -0
  83. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/types/AdInfo.d.ts +15 -0
  85. package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/types/AdProps.d.ts +0 -1
  87. package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
  88. package/lib/typescript/module/plugin/src/index.d.ts +2 -6
  89. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -1
  90. package/lib/typescript/module/plugin/src/withAndroid.d.ts +2 -6
  91. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -1
  92. package/lib/typescript/module/plugin/src/withIos.d.ts +2 -6
  93. package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -1
  94. package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
  95. package/lib/typescript/module/src/AppOpenAd.d.ts +2 -2
  96. package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
  97. package/lib/typescript/module/src/{DaroMAdBannerViewNativeComponent.d.ts → DaroRNAdBannerViewNativeComponent.d.ts} +3 -2
  98. package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -0
  99. package/lib/typescript/module/src/{DaroMNativeAdViewNativeComponent.d.ts → DaroRNNativeAdViewNativeComponent.d.ts} +3 -2
  100. package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -0
  101. package/lib/typescript/module/src/NativeDaroModule.d.ts +10 -1
  102. package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
  103. package/lib/typescript/module/src/index.d.ts +79 -0
  104. package/lib/typescript/module/src/index.d.ts.map +1 -1
  105. package/lib/typescript/module/src/types/AdInfo.d.ts +15 -0
  106. package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
  107. package/lib/typescript/module/src/types/AdProps.d.ts +0 -1
  108. package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
  109. package/package.json +3 -3
  110. package/plugin/build/index.d.ts +2 -6
  111. package/plugin/build/index.js +21 -56
  112. package/plugin/build/withAndroid.d.ts +2 -6
  113. package/plugin/build/withAndroid.js +48 -90
  114. package/plugin/build/withIos.d.ts +2 -6
  115. package/plugin/build/withIos.js +37 -33
  116. package/react-native-daro.podspec +2 -3
  117. package/src/AdBannerView.tsx +1 -3
  118. package/src/AppOpenAd.ts +2 -8
  119. package/{lib/module/DaroMAdBannerViewNativeComponent.ts → src/DaroRNAdBannerViewNativeComponent.ts} +5 -2
  120. package/{lib/module/DaroMNativeAdViewNativeComponent.ts → src/DaroRNNativeAdViewNativeComponent.ts} +5 -2
  121. package/src/NativeDaroModule.ts +17 -2
  122. package/src/index.tsx +136 -0
  123. package/src/nativeAd/NativeAdView.tsx +1 -1
  124. package/src/types/AdInfo.ts +17 -0
  125. package/src/types/AdProps.ts +0 -2
  126. package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +0 -23
  127. package/android/src/main/java/com/daro/reactnative/DaroMAdBannerViewManager.kt +0 -155
  128. package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +0 -257
  129. package/ios/Fabric/DaroMAdBannerComponentView.mm +0 -207
  130. package/ios/Fabric/DaroMNativeAdComponentView.mm +0 -294
  131. package/ios/Paper/DaroMNativeAdViewManager.swift +0 -22
  132. package/ios/mediation/admob/DaroMediationDebugger.swift +0 -11
  133. package/lib/commonjs/types/DaroMMobileAds.js +0 -2
  134. package/lib/commonjs/types/DaroMMobileAds.js.map +0 -1
  135. package/lib/module/types/DaroMMobileAds.js +0 -2
  136. package/lib/module/types/DaroMMobileAds.js.map +0 -1
  137. package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
  138. package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
  139. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts +0 -6
  140. package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +0 -1
  141. package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +0 -1
  142. package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +0 -1
  143. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts +0 -6
  144. package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +0 -1
  145. package/src/types/DaroMMobileAds.ts +0 -5
  146. /package/ios/{mediation/admob → Shared}/DaroMediationTypes.swift +0 -0
@@ -1,72 +1,40 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.withAndroidConfiguration = void 0;
37
4
  const config_plugins_1 = require("expo/config-plugins");
38
- const fs = __importStar(require("fs"));
39
- const path = __importStar(require("path"));
40
- const KEY_FILE_NAME = 'android-daro-key.txt';
41
5
  const JETIFIER_IGNORELIST_KEY = 'android.jetifier.ignorelist';
42
6
  const JETIFIER_IGNORELIST_ENTRIES = ['react-android', 'hermes-android'];
43
- const DARO_GRADLE_PLUGIN_CLASSPATH = 'so.daro:daro-plugin:1.0.13';
7
+ // daro-sdk Google 미디에이션 어댑터들(fyber·inmobi·ironsource 등)이 kotlin-stdlib
8
+ // 2.3.0 을 끌어온다 — 2.3 메타데이터는 Kotlin ≥2.2 컴파일러만 읽는다. Expo 기본
9
+ // 툴체인(2.1.x)은 컴파일이 깨지므로, 앱이 직접 지정하지 않았을 때만 올려준다.
10
+ // 2.2.20 인 이유: Expo 의 Kotlin→KSP 매핑이 지원하는 최신 2.2 계열이다.
11
+ const KOTLIN_VERSION_KEY = 'android.kotlinVersion';
12
+ const MIN_KOTLIN_VERSION = '2.2.20';
13
+ const DARO_GRADLE_PLUGIN_CLASSPATH = 'so.daro:daro-plugin:1.1.0-beta04';
14
+ // 통합 so.daro 플러그인이 release 빌드에 applovin-quality-service 를 스스로 적용한다 —
15
+ // 그 플러그인 id 가 해석되려면 classpath 와 AppLovin buildscript repo 가 앱에 있어야 한다.
44
16
  const MAX_QUALITY_CLASSPATH = 'com.applovin.quality:AppLovinQualityServiceGradlePlugin:5.5.2';
45
17
  const APPLOVIN_MAVEN_REPO = 'https://artifacts.applovin.com/android';
46
- const MAX_ALLPROJECTS_MAVEN_REPOS = [
47
- 'https://android-sdk.is.com',
48
- 'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea',
49
- 'https://maven.ogury.co',
50
- 'https://artifact.bytedance.com/repository/pangle',
51
- 'https://s3.amazonaws.com/smaato-sdk-releases/',
52
- 'https://cboost.jfrog.io/artifactory/chartboost-ads/',
53
- APPLOVIN_MAVEN_REPO,
54
- ];
55
- const DARO_APP_PLUGIN_IDS = {
56
- admob: 'so.daro.a',
57
- max: 'so.daro.m',
58
- };
59
- const DARO_SDK_DEPENDENCIES = {
60
- admob: 'so.daro:daro-a:1.5.5',
61
- max: 'so.daro:daro-m:1.3.8',
62
- };
63
- const DARO_SDK_DEPENDENCY_LINE_PATTERN = /^\s*(?:implementation|api|compileOnly|runtimeOnly)\s*(?:\(\s*)?['"]so\.daro:daro-[am]:[^'"]+['"]\s*\)?\s*(?:\/\/.*)?$/gm;
18
+ // 통합 daro-sdk 가 싣는 어댑터 전체의 repo 목록 — android/daro-android-qa
19
+ // settings.gradle.kts 의 검증된 목록을 미러링한다 (QA 앱이 같은 좌표를 해결한다).
64
20
  const DARO_MAVEN_REPOS = [
65
21
  'https://artifact.bytedance.com/repository/pangle',
66
- 'https://cboost.jfrog.io/artifactory/chartboost-ads/',
22
+ 'https://verve.jfrog.io/artifactory/verve-gradle-release',
67
23
  'https://android-sdk.is.com',
68
24
  'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea',
25
+ 'https://repo.premiumads.net/artifactory/mobile-ads-sdk/',
26
+ 'https://repo.pubmatic.com/artifactory/public-repos',
27
+ 'https://maven.ogury.co',
28
+ APPLOVIN_MAVEN_REPO,
69
29
  ];
30
+ const DARO_APP_PLUGIN_ID = 'so.daro';
31
+ const DARO_APP_PLUGIN_LINE = `apply plugin: "${DARO_APP_PLUGIN_ID}"`;
32
+ // **이 값은 android/build.gradle 의 daroSdkDependency 와 같아야 한다.** 라이브러리는
33
+ // compileOnly 로 물고 compileOnly 는 전이되지 않으므로, 소비자 런타임에 실제로 실리는
34
+ // 것은 여기서 꽂는 이 좌표 하나뿐이다. 갈리면 우리 Kotlin 이 새 시그니처로 컴파일되어
35
+ // 옛 아티팩트 위에서 돈다 (DARO-1591 — 복제 자체를 없애는 것은 그 이슈에 남아 있다).
36
+ const DARO_SDK_DEPENDENCY = 'so.daro:daro-sdk:2.0.0-rc.2';
37
+ const DARO_SDK_DEPENDENCY_LINE_PATTERN = /^\s*(?:implementation|api|compileOnly|runtimeOnly)\s*(?:\(\s*)?['"]so\.daro:daro-(?:[am]|sdk):[^'"]+['"]\s*\)?\s*(?:\/\/.*)?$/gm;
70
38
  function replaceOrThrow(contents, pattern, replacement, target) {
71
39
  if (!pattern.test(contents)) {
72
40
  throw new Error(`[daro-react-native] Cannot automatically update android/build.gradle. ` +
@@ -123,7 +91,7 @@ function findRepositoryInsertIndex(repositoriesBlock) {
123
91
  preferredAnchor[0].length
124
92
  : repositoriesBlock.insertIndex;
125
93
  }
126
- function addMaxBuildscriptRepository(contents) {
94
+ function addAppLovinBuildscriptRepository(contents) {
127
95
  const repositoriesBlock = findRepositoriesBlock(contents, /buildscript\s*\{[\s\S]*?repositories\s*\{/, 'a buildscript repositories block');
128
96
  if (repositoriesBlock.contents.includes(APPLOVIN_MAVEN_REPO)) {
129
97
  return contents;
@@ -133,9 +101,6 @@ function addMaxBuildscriptRepository(contents) {
133
101
  return `${contents.slice(0, insertIndex)}${repositoryLine}${contents.slice(insertIndex)}`;
134
102
  }
135
103
  const withAndroidConfiguration = (config, props) => {
136
- const { mediation } = props;
137
- const daroAppPluginId = DARO_APP_PLUGIN_IDS[mediation];
138
- const daroSdkDependency = DARO_SDK_DEPENDENCIES[mediation];
139
104
  // 1. project build.gradle: classpath + maven repos
140
105
  config = (0, config_plugins_1.withProjectBuildGradle)(config, (gradleConfig) => {
141
106
  if (gradleConfig.modResults.language !== 'groovy') {
@@ -146,39 +111,47 @@ const withAndroidConfiguration = (config, props) => {
146
111
  if (!contents.includes(DARO_GRADLE_PLUGIN_CLASSPATH)) {
147
112
  contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n classpath("${DARO_GRADLE_PLUGIN_CLASSPATH}")`, 'a buildscript dependencies block');
148
113
  }
149
- if (mediation === 'max' && !contents.includes(MAX_QUALITY_CLASSPATH)) {
114
+ if (!contents.includes(MAX_QUALITY_CLASSPATH)) {
150
115
  contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n classpath("${MAX_QUALITY_CLASSPATH}")`, 'a buildscript dependencies block');
151
116
  }
152
- contents = addMavenRepositories(contents, /allprojects\s*\{[\s\S]*?repositories\s*\{/, mediation === 'max' ? MAX_ALLPROJECTS_MAVEN_REPOS : DARO_MAVEN_REPOS, 'an allprojects repositories block');
153
- if (mediation === 'max') {
154
- contents = addMaxBuildscriptRepository(contents);
155
- }
117
+ contents = addMavenRepositories(contents, /allprojects\s*\{[\s\S]*?repositories\s*\{/, DARO_MAVEN_REPOS, 'an allprojects repositories block');
118
+ contents = addAppLovinBuildscriptRepository(contents);
119
+ // 버전 없는 KGP classpath 는 RN gradle plugin 제약(2.1.x)으로 해석된다 —
120
+ // android.kotlinVersion 속성만으로는 앱 모듈 컴파일러가 안 바뀌므로 여기서 버전을
121
+ // 명시해 conflict resolution 에서 이기게 한다 (위 MIN_KOTLIN_VERSION 주석 참조).
122
+ contents = contents.replace(/classpath\((['"])org\.jetbrains\.kotlin:kotlin-gradle-plugin\1\)/, `classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:${MIN_KOTLIN_VERSION}')`);
156
123
  gradleConfig.modResults.contents = contents;
157
124
  return gradleConfig;
158
125
  });
159
- // 2. app/build.gradle: add selected Daro SDK dependency and plugin.
126
+ // 2. app/build.gradle: add the unified Daro SDK dependency and plugin.
160
127
  config = (0, config_plugins_1.withAppBuildGradle)(config, (gradleConfig) => {
161
128
  if (gradleConfig.modResults.language !== 'groovy') {
162
129
  config_plugins_1.WarningAggregator.addWarningAndroid('daro-react-native', 'Cannot automatically configure app/build.gradle if it is not groovy.');
163
130
  return gradleConfig;
164
131
  }
165
- let contents = gradleConfig.modResults.contents.replace(/\n?apply plugin: ['"]so\.daro\.[am]['"]\n?/g, '\n');
132
+ let contents = gradleConfig.modResults.contents.replace(/\n?apply plugin: ['"]so\.daro(?:\.[am])?['"]\n?/g, '\n');
166
133
  contents = contents.replace(DARO_SDK_DEPENDENCY_LINE_PATTERN, '');
167
- contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n implementation("${daroSdkDependency}")`, 'an app dependencies block');
168
- if (!contents.includes(daroAppPluginId)) {
169
- contents = `${contents.trimEnd()}\napply plugin: "${daroAppPluginId}"\n`;
170
- }
134
+ contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n implementation("${DARO_SDK_DEPENDENCY}")`, 'an app dependencies block');
135
+ contents = `${contents.trimEnd()}\n${DARO_APP_PLUGIN_LINE}\n`;
171
136
  gradleConfig.modResults.contents = contents;
172
137
  return gradleConfig;
173
138
  });
174
- // 3. gradle.properties: daroAppKey + Jetifier
175
- config = (0, config_plugins_1.withGradleProperties)(config, (propertiesConfig) => {
139
+ // 3. gradle.properties: daroIntegrationKey + Jetifier
140
+ // so.daro 플러그인이 빌드타임에 속성을 풀어 manifestPlaceholders 를 채운다.
141
+ return (0, config_plugins_1.withGradleProperties)(config, (propertiesConfig) => {
142
+ if (!props.daroIntegrationKey?.trim()) {
143
+ throw new Error('[daro-react-native] "android.daroIntegrationKey" is required. ' +
144
+ 'Set it to the INTEGRATION KEY issued for your Android app.');
145
+ }
176
146
  const entries = [
177
- { key: 'daroMediation', value: mediation },
178
- { key: 'daroAppKey', value: props.daroAppKey },
147
+ { key: 'daroIntegrationKey', value: props.daroIntegrationKey },
179
148
  { key: 'android.useAndroidX', value: 'true' },
180
149
  { key: 'android.enableJetifier', value: 'true' },
181
150
  ];
151
+ const hasKotlinVersion = propertiesConfig.modResults.some((item) => item.type === 'property' && item.key === KOTLIN_VERSION_KEY);
152
+ if (!hasKotlinVersion) {
153
+ entries.push({ key: KOTLIN_VERSION_KEY, value: MIN_KOTLIN_VERSION });
154
+ }
182
155
  const existingIgnorelist = propertiesConfig.modResults
183
156
  .filter((item) => item.type === 'property' && item.key === JETIFIER_IGNORELIST_KEY)
184
157
  .flatMap((item) => item.value.split(','))
@@ -203,20 +176,5 @@ const withAndroidConfiguration = (config, props) => {
203
176
  }
204
177
  return propertiesConfig;
205
178
  });
206
- // 4. daroKeyFile을 android/app/ 루트에 복사
207
- return (0, config_plugins_1.withDangerousMod)(config, [
208
- 'android',
209
- async (dangerousConfig) => {
210
- const sourcePath = path.resolve(dangerousConfig.modRequest.projectRoot, props.daroKeyFile);
211
- if (!fs.existsSync(sourcePath)) {
212
- throw new Error(`[daro-react-native] Cannot find Android key file at "${sourcePath}". ` +
213
- `Set "android.daroKeyFile" in plugin options to a valid path.`);
214
- }
215
- const destinationPath = path.resolve(dangerousConfig.modRequest.platformProjectRoot, 'app', KEY_FILE_NAME);
216
- fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
217
- fs.copyFileSync(sourcePath, destinationPath);
218
- return dangerousConfig;
219
- },
220
- ]);
221
179
  };
222
180
  exports.withAndroidConfiguration = withAndroidConfiguration;
@@ -1,7 +1,3 @@
1
1
  import type { ConfigPlugin } from 'expo/config-plugins';
2
- import type { DaroIosProps, DaroMediation } from './index';
3
- type DaroResolvedIosProps = DaroIosProps & {
4
- mediation: DaroMediation;
5
- };
6
- export declare const withIosConfiguration: ConfigPlugin<DaroResolvedIosProps>;
7
- export {};
2
+ import type { DaroIosProps } from './index';
3
+ export declare const withIosConfiguration: ConfigPlugin<DaroIosProps>;
@@ -38,45 +38,49 @@ const config_plugins_1 = require("expo/config-plugins");
38
38
  const fs = __importStar(require("fs"));
39
39
  const path = __importStar(require("path"));
40
40
  const skAdNetworkIds_1 = require("./skAdNetworkIds");
41
- const KEY_FILE_NAME = 'ios-daro-key.txt';
42
41
  const DEFAULT_ATT_USAGE_DESCRIPTION = 'This identifier will be used to deliver personalized ads to you.';
42
+ // pod install 때 통합 Daro pod 에 실려 오는 INTEGRATION KEY 훅. 소스 Info.plist 의
43
+ // DaroIntegrationKey 를 풀어 DaroAppKey·GADApplicationIdentifier·AppLovin 키를 심는다.
44
+ // post_install 블록은 Podfile 에 하나만 둘 수 있으므로 Expo 가 생성한 기존 블록 안에
45
+ // 끼워 넣는다 — 새로 선언하면 CocoaPods 가 죽는다.
46
+ const PODFILE_HOOK_MARKER = 'daro_integration_key';
47
+ const PODFILE_HOOK_LINES = ` daro_integration_key_hook = Dir.glob(File.expand_path('Pods/*/**/Scripts/daro_integration_key.rb', __dir__)).first
48
+ raise '[Daro] INTEGRATION KEY hook not found in pods — is the published pod carrying Scripts/?' unless daro_integration_key_hook
49
+ require daro_integration_key_hook
50
+ Daro::IntegrationKey.install!(installer)`;
43
51
  const withIosConfiguration = (config, props) => {
44
- const { mediation } = props;
45
- config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
46
- config.modResults.DaroAppKey = props.daroAppKey;
47
- config.modResults.NSUserTrackingUsageDescription =
48
- props.attUsageDescription ?? DEFAULT_ATT_USAGE_DESCRIPTION;
49
- if (!props.admobAppId) {
50
- throw new Error(`[daro-react-native] "ios.admobAppId" is required when mediation is "${mediation}". ` +
51
- 'Google Mobile Ads SDK requires GADApplicationIdentifier.');
52
+ config = (0, config_plugins_1.withInfoPlist)(config, (plistConfig) => {
53
+ if (!props.daroIntegrationKey?.trim()) {
54
+ throw new Error('[daro-react-native] "ios.daroIntegrationKey" is required. ' +
55
+ 'Set it to the INTEGRATION KEY issued for your iOS app.');
52
56
  }
53
- config.modResults.GADApplicationIdentifier = props.admobAppId;
57
+ plistConfig.modResults.DaroIntegrationKey = props.daroIntegrationKey;
58
+ plistConfig.modResults.NSUserTrackingUsageDescription =
59
+ props.attUsageDescription ?? DEFAULT_ATT_USAGE_DESCRIPTION;
54
60
  // SKAdNetworkItems: 사용자가 미리 추가한 항목과 머지 (중복 제거)
55
- const existing = config.modResults.SKAdNetworkItems ??
56
- [];
61
+ const existing = plistConfig.modResults.SKAdNetworkItems ?? [];
57
62
  const existingIds = new Set(existing.map((item) => item.SKAdNetworkIdentifier));
58
63
  const additions = skAdNetworkIds_1.DARO_SK_AD_NETWORK_IDS.filter((id) => !existingIds.has(id)).map((id) => ({ SKAdNetworkIdentifier: id }));
59
- config.modResults.SKAdNetworkItems = [...existing, ...additions];
60
- return config;
61
- });
62
- return (0, config_plugins_1.withXcodeProject)(config, (config) => {
63
- const projectRoot = config.modRequest.projectRoot;
64
- const projectName = config.modRequest.projectName ??
65
- config_plugins_1.IOSConfig.XcodeUtils.getProjectName(projectRoot);
66
- const sourcePath = path.resolve(projectRoot, props.daroKeyFile);
67
- if (!fs.existsSync(sourcePath)) {
68
- throw new Error(`[daro-react-native] Cannot find iOS key file at "${sourcePath}". ` +
69
- `Set "ios.daroKeyFile" in plugin options to a valid path.`);
70
- }
71
- const destinationPath = path.resolve(config_plugins_1.IOSConfig.Paths.getSourceRoot(projectRoot), KEY_FILE_NAME);
72
- fs.copyFileSync(sourcePath, destinationPath);
73
- config_plugins_1.IOSConfig.XcodeUtils.addResourceFileToGroup({
74
- filepath: `${projectName}/${KEY_FILE_NAME}`,
75
- groupName: projectName,
76
- project: config.modResults,
77
- isBuildFile: true,
78
- });
79
- return config;
64
+ plistConfig.modResults.SKAdNetworkItems = [...existing, ...additions];
65
+ return plistConfig;
80
66
  });
67
+ return (0, config_plugins_1.withDangerousMod)(config, [
68
+ 'ios',
69
+ async (dangerousConfig) => {
70
+ const podfilePath = path.join(dangerousConfig.modRequest.platformProjectRoot, 'Podfile');
71
+ const contents = fs.readFileSync(podfilePath, 'utf8');
72
+ if (contents.includes(PODFILE_HOOK_MARKER)) {
73
+ return dangerousConfig;
74
+ }
75
+ const anchor = /post_install do \|installer\|\n/;
76
+ if (!anchor.test(contents)) {
77
+ throw new Error('[daro-react-native] Cannot find a "post_install do |installer|" ' +
78
+ 'block in the generated Podfile to install the Daro INTEGRATION ' +
79
+ 'KEY hook into.');
80
+ }
81
+ fs.writeFileSync(podfilePath, contents.replace(anchor, (match) => `${match}${PODFILE_HOOK_LINES}\n`));
82
+ return dangerousConfig;
83
+ },
84
+ ]);
81
85
  };
82
86
  exports.withIosConfiguration = withIosConfiguration;
@@ -17,12 +17,11 @@ Pod::Spec.new do |s|
17
17
  "ios/*.{h,m,mm,swift,cpp}",
18
18
  "ios/Shared/**/*.{h,m,mm,swift,cpp}",
19
19
  "ios/Paper/**/*.{h,m,mm,swift,cpp}",
20
- "ios/Fabric/**/*.{h,m,mm,swift,cpp}",
21
- "ios/mediation/admob/**/*.{h,m,mm,swift,cpp}"
20
+ "ios/Fabric/**/*.{h,m,mm,swift,cpp}"
22
21
  ]
23
22
  s.private_header_files = "ios/**/*.h"
24
23
 
25
- s.dependency "DaroAds", "1.1.59"
24
+ s.dependency "DaroAds", "2.0.0-rc.5"
26
25
 
27
26
  install_modules_dependencies(s)
28
27
  end
@@ -10,7 +10,7 @@ import {
10
10
  import { View, type ViewProps } from 'react-native';
11
11
  import AdBannerViewNativeComponent, {
12
12
  Commands,
13
- } from './DaroMAdBannerViewNativeComponent';
13
+ } from './DaroRNAdBannerViewNativeComponent';
14
14
  import NativeDaroModule from './NativeDaroModule';
15
15
  import type {
16
16
  AdBannerViewHandler,
@@ -47,7 +47,6 @@ export const AdBannerView = forwardRef<
47
47
  {
48
48
  adUnitId,
49
49
  adFormat,
50
- placement,
51
50
  loadOnMount = true,
52
51
  isVisible = true,
53
52
  onAdLoaded,
@@ -127,7 +126,6 @@ export const AdBannerView = forwardRef<
127
126
  adFormat={toNativeAdFormat(adFormat)}
128
127
  ref={saveElement}
129
128
  adUnitId={adUnitId}
130
- placement={placement}
131
129
  loadOnMount={loadOnMount}
132
130
  isVisible={isVisible}
133
131
  onAdLoadedEvent={onAdLoadedEvent}
package/src/AppOpenAd.ts CHANGED
@@ -70,7 +70,7 @@ export class AppOpenAd {
70
70
  NativeDaroModule.loadAppOpenAd(this.requestId, this.adUnitId);
71
71
  }
72
72
 
73
- show(placement?: string | null, customData?: string | null): void {
73
+ show(customData?: string | null): void {
74
74
  if (!IS_SUPPORTED_PLATFORM) {
75
75
  warnUnsupportedPlatform();
76
76
  return;
@@ -78,7 +78,6 @@ export class AppOpenAd {
78
78
  NativeDaroModule.showAppOpenAd(
79
79
  this.requestId,
80
80
  this.adUnitId,
81
- placement ?? undefined,
82
81
  customData ?? undefined
83
82
  );
84
83
  }
@@ -155,11 +154,7 @@ export class AppOpenAd {
155
154
  }
156
155
 
157
156
  /** @deprecated `AppOpenAd.createForAdRequest(adUnitId)` 인스턴스의 `show()`를 사용하세요. */
158
- static showAd(
159
- adUnitId: string,
160
- placement?: string | null,
161
- customData?: string | null
162
- ): void {
157
+ static showAd(adUnitId: string, customData?: string | null): void {
163
158
  if (!IS_SUPPORTED_PLATFORM) {
164
159
  warnUnsupportedPlatform();
165
160
  return;
@@ -168,7 +163,6 @@ export class AppOpenAd {
168
163
  NativeDaroModule.showAppOpenAd(
169
164
  requestId,
170
165
  adUnitId,
171
- placement ?? undefined,
172
166
  customData ?? undefined
173
167
  );
174
168
  }
@@ -10,9 +10,13 @@ import type {
10
10
  WithDefault,
11
11
  } from 'react-native/Libraries/Types/CodegenTypes';
12
12
 
13
+ // 필드 구성은 src/types/AdInfo.ts 의 AdInfo 와 같은 것을 뜻한다. 이쪽은 codegen 이
14
+ // 읽는 선언이라 **여기 없으면 네이티브가 실어 보내도 Fabric 이 걸러낸다.**
13
15
  type AdInfoPayload = {
14
16
  adUnitId: string;
15
17
  latencyMillis: Double;
18
+ mediationPlatform?: string;
19
+ adNetwork?: string;
16
20
  };
17
21
 
18
22
  type AdLoadFailedInfoPayload = {
@@ -25,7 +29,6 @@ type AdLoadFailedInfoPayload = {
25
29
  export interface NativeProps extends ViewProps {
26
30
  adUnitId: string;
27
31
  adFormat: string;
28
- placement?: string | null;
29
32
  loadOnMount?: WithDefault<boolean, true>;
30
33
  isVisible?: WithDefault<boolean, true>;
31
34
  onAdLoadedEvent?: DirectEventHandler<AdInfoPayload>;
@@ -44,4 +47,4 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
44
47
  supportedCommands: ['loadAd'],
45
48
  });
46
49
 
47
- export default codegenNativeComponent<NativeProps>('DaroMAdBannerView');
50
+ export default codegenNativeComponent<NativeProps>('DaroRNAdBannerView');
@@ -11,9 +11,13 @@ import type {
11
11
  WithDefault,
12
12
  } from 'react-native/Libraries/Types/CodegenTypes';
13
13
 
14
+ // 필드 구성은 src/types/AdInfo.ts 의 AdInfo 와 같은 것을 뜻한다. 이쪽은 codegen 이
15
+ // 읽는 선언이라 **여기 없으면 네이티브가 실어 보내도 Fabric 이 걸러낸다.**
14
16
  type AdInfoPayload = {
15
17
  adUnitId: string;
16
18
  latencyMillis: Double;
19
+ mediationPlatform?: string;
20
+ adNetwork?: string;
17
21
  };
18
22
 
19
23
  type AdLoadFailedInfoPayload = {
@@ -27,7 +31,6 @@ type AdChoicesPosition = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
27
31
 
28
32
  export interface NativeProps extends ViewProps {
29
33
  adUnitId: string;
30
- placement?: string | null;
31
34
  loadOnMount?: WithDefault<boolean, true>;
32
35
  adChoicesPosition?: WithDefault<AdChoicesPosition, 'bottomRight'>;
33
36
 
@@ -59,4 +62,4 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
59
62
  supportedCommands: ['loadAd'],
60
63
  });
61
64
 
62
- export default codegenNativeComponent<NativeProps>('DaroMNativeAdView');
65
+ export default codegenNativeComponent<NativeProps>('DaroRNNativeAdView');
@@ -52,7 +52,23 @@ export interface Spec extends TurboModule {
52
52
  isInitialized: () => Promise<boolean>;
53
53
  initializeSdk: () => Promise<void>;
54
54
  setUserId: (userId: string) => Promise<void>;
55
+
56
+ // 동의 상태는 **문자열**로 건넨다. Android 는 enum 이름, iOS 는 Int raw value 라
57
+ // 표현이 애초에 다르고, 어느 한쪽 표현을 브리지 계약으로 삼으면 다른 쪽이 그것을
58
+ // 되옮기다 조용히 틀린다 — Flutter 가 Android enum 이름(`nativeName`)을 그대로
59
+ // 넘겨 iOS 에서 깨진 전례가 있다(DARO-1471). 여기서는 플랫폼 중립 문자열만 오가고,
60
+ // 각 네이티브 어댑터가 자기 표현으로 옮긴다.
61
+ setGdpr: (status: string, consentString: string) => Promise<void>;
62
+ setCcpa: (status: string, consentString: string) => Promise<void>;
63
+ setCoppa: (status: string) => Promise<void>;
64
+
55
65
  showMediationDebugger: () => Promise<void>;
66
+ showMediationDebuggerFor: (mediation: string) => Promise<void>;
67
+ getSdkVersion: () => Promise<string | null>;
68
+ getMediationStatuses: () => Promise<UnsafeObject[] | null>;
69
+ getMediationWeights: () => Promise<UnsafeObject | null>;
70
+ getAdapterInventory: () => Promise<UnsafeObject>;
71
+ getIntegrationKeyInfo: () => Promise<UnsafeObject>;
56
72
 
57
73
  isInterstitialReady: (
58
74
  requestId: Double,
@@ -74,7 +90,6 @@ export interface Spec extends TurboModule {
74
90
  showAppOpenAd: (
75
91
  requestId: Double,
76
92
  adUnitId: string,
77
- placement?: string | null,
78
93
  customData?: string | null
79
94
  ) => Promise<void>;
80
95
 
@@ -88,4 +103,4 @@ export interface Spec extends TurboModule {
88
103
  ) => Promise<void>;
89
104
  }
90
105
 
91
- export default TurboModuleRegistry.getEnforcing<Spec>('DaroMModule');
106
+ export default TurboModuleRegistry.getEnforcing<Spec>('DaroRNModule');
package/src/index.tsx CHANGED
@@ -35,6 +35,73 @@ export async function initialize() {
35
35
  await NativeDaroModule.initializeSdk();
36
36
  }
37
37
 
38
+ export async function isInitialized(): Promise<boolean> {
39
+ return NativeDaroModule.isInitialized();
40
+ }
41
+
42
+ export type DaroMediationStatus = {
43
+ mediationPlatform: string;
44
+ isReady: boolean;
45
+ hasFailed: boolean;
46
+ };
47
+
48
+ // 키가 공개 어휘(`daroa`/`darom`)를 따른다 (DARO-1594). 한때 `admob`/`applovin` 이었고
49
+ // 그것은 벤더 이름이라 공개 표면에서 걷었다.
50
+ export type DaroMediationWeights = {
51
+ daroa: number;
52
+ darom: number;
53
+ };
54
+
55
+ export async function getSdkVersion(): Promise<string | null> {
56
+ return (await NativeDaroModule.getSdkVersion()) ?? null;
57
+ }
58
+
59
+ export async function getMediationStatuses(): Promise<
60
+ DaroMediationStatus[] | null
61
+ > {
62
+ const statuses = await NativeDaroModule.getMediationStatuses();
63
+ return (statuses as DaroMediationStatus[] | null) ?? null;
64
+ }
65
+
66
+ export async function getMediationWeights(): Promise<DaroMediationWeights | null> {
67
+ const weights = await NativeDaroModule.getMediationWeights();
68
+ return (weights as DaroMediationWeights | null) ?? null;
69
+ }
70
+
71
+ /**
72
+ * 미디에이션별 벤더 검사기를 띄운다.
73
+ *
74
+ * 값은 {@link DaroAdInfo.mediationPlatform} 과 **같은 어휘**다. 구 어휘
75
+ * (`admob`/`applovin`)도 네이티브가 아직 받아주지만 타입으로는 광고하지 않는다 —
76
+ * 벤더 이름을 공개 표면에서 걷는 것이 이 어휘를 만든 이유다.
77
+ */
78
+ export async function showMediationDebuggerFor(mediation: 'daroa' | 'darom') {
79
+ await NativeDaroModule.showMediationDebuggerFor(mediation);
80
+ }
81
+
82
+ export type DaroAdapterRow = {
83
+ name: string;
84
+ detail: string;
85
+ isReady: boolean;
86
+ };
87
+
88
+ // QA 전용 — 벤더 SDK(GMA·MAX)에 직접 묻는다. SDK 는 서브네트워크 목록을 갖지 않는다.
89
+ export async function getAdapterInventory(): Promise<
90
+ Record<string, DaroAdapterRow[]>
91
+ > {
92
+ const inventory = await NativeDaroModule.getAdapterInventory();
93
+ return inventory as Record<string, DaroAdapterRow[]>;
94
+ }
95
+
96
+ // QA 전용 — 주입 결과(런타임 plist/manifest)의 파생 키를 그대로 돌려준다. JS 는
97
+ // 원문을 읽을 수 없어 이 브리지가 유일한 창이다. 판정·마스킹은 앱이 한다.
98
+ export async function getIntegrationKeyInfo(): Promise<
99
+ Record<string, string | null>
100
+ > {
101
+ const info = await NativeDaroModule.getIntegrationKeyInfo();
102
+ return info as Record<string, string | null>;
103
+ }
104
+
38
105
  export async function showMediationDebugger() {
39
106
  await NativeDaroModule.showMediationDebugger();
40
107
  }
@@ -42,3 +109,72 @@ export async function showMediationDebugger() {
42
109
  export async function setUserId(userId: string) {
43
110
  await NativeDaroModule.setUserId(userId);
44
111
  }
112
+
113
+ /**
114
+ * GDPR 동의 상태. `unknown` 이 SDK 기본값(미확정)이다.
115
+ *
116
+ * **네이티브의 표현을 노출하지 않는다.** Android 는 `GdprStatus` enum 이름
117
+ * (`OPT_IN`…), iOS 는 `DaroGdprStatus` 의 Int raw value(0…3)로 같은 개념을 서로 다르게
118
+ * 적는다. 둘 중 하나를 골라 JS 계약으로 삼으면 나머지 플랫폼이 그 표현을 되옮겨야 하고,
119
+ * 되옮기는 코드가 없거나 낡으면 **에러 없이 틀린 상태가 전달된다** — Flutter 가 Android
120
+ * enum 이름을 그대로 보내 iOS 에서 어긋난 것이 그 사고다(DARO-1471). 그래서 JS 는 어느
121
+ * 플랫폼 것도 아닌 문자열을 쓰고, 옮기는 일은 각 네이티브 어댑터가 자기 쪽에서 한다.
122
+ */
123
+ export type DaroGdprStatus = 'optIn' | 'optOut' | 'notApplicable' | 'unknown';
124
+
125
+ /** CCPA 동의 상태. GDPR 과 달리 `unknown` 이 없다. */
126
+ export type DaroCcpaStatus = 'optIn' | 'optOut' | 'notApplicable';
127
+
128
+ /** 퍼블리셔가 선언하는 COPPA 아동 대상 여부. */
129
+ export type DaroCoppaStatus = 'child' | 'notChild';
130
+
131
+ /**
132
+ * GDPR 동의 상태를 설정한다.
133
+ *
134
+ * **{@link initialize} 전에 호출한다.** 동의는 첫 광고 요청보다 먼저 확정돼 있어야 한다.
135
+ * 셋 중 {@link setCoppa} 는 이것이 권고가 아니라 요구이고, 나머지 둘의 순서를 거기에
136
+ * 맞춘다 — 세 API 의 규칙이 갈리면 지키는 쪽이 더 어렵다.
137
+ *
138
+ * 모르는 상태 문자열은 **기본값으로 떨어지지 않고 reject 된다**(`INVALID_CONSENT_STATUS`).
139
+ * 동의는 조용히 틀리면 안 되는 값이라, 오타가 "일단 옵트인"으로 흡수되는 쪽이 더 나쁘다.
140
+ *
141
+ * **이미 넘긴 동의 문자열이 있으면 상태만 갱신할 때도 같이 넘겨라.** 빈 문자열은 양쪽
142
+ * 플랫폼 모두 건너뛰므로 이전 값이 지워지지는 않지만, 상태와 문자열을 한 호출로 함께
143
+ * 넘기면 어느 쪽이 최신인지 따질 일이 아예 없다.
144
+ *
145
+ * @param consentString IAB TCF 동의 문자열. 없으면 비워 둔다.
146
+ */
147
+ export async function setGdpr(
148
+ status: DaroGdprStatus,
149
+ consentString: string = ''
150
+ ) {
151
+ await NativeDaroModule.setGdpr(status, consentString);
152
+ }
153
+
154
+ /**
155
+ * CCPA 동의 상태를 설정한다.
156
+ *
157
+ * **{@link initialize} 전에 호출한다** — {@link setGdpr} 과 같은 이유다.
158
+ *
159
+ * `consentString` 취급도 {@link setGdpr} 과 같다 — 빈 문자열은 이전 값을 덮지 않고,
160
+ * 상태만 갱신할 때도 이미 넘긴 문자열이 있으면 같이 넘기는 편이 낫다.
161
+ *
162
+ * @param consentString IAB US Privacy 문자열. 없으면 비워 둔다.
163
+ */
164
+ export async function setCcpa(
165
+ status: DaroCcpaStatus,
166
+ consentString: string = ''
167
+ ) {
168
+ await NativeDaroModule.setCcpa(status, consentString);
169
+ }
170
+
171
+ /**
172
+ * COPPA 아동 대상 여부를 설정한다.
173
+ *
174
+ * **{@link initialize} 전에 호출한다.** 셋 중 이것만은 순서가 권고가 아니라 요구다 —
175
+ * 아동 대상으로 선언하면 광고 식별자 전송이 차단되는데, 그 차단이 **초기화 요청부터**
176
+ * 걸려야 한다. 초기화 뒤에 부르면 첫 요청은 이미 식별자를 달고 나간 뒤다.
177
+ */
178
+ export async function setCoppa(status: DaroCoppaStatus) {
179
+ await NativeDaroModule.setCoppa(status);
180
+ }
@@ -11,7 +11,7 @@ import {
11
11
  import { View, type ViewProps } from 'react-native';
12
12
  import NativeAdViewNativeComponent, {
13
13
  Commands,
14
- } from '../DaroMNativeAdViewNativeComponent';
14
+ } from '../DaroRNNativeAdViewNativeComponent';
15
15
  import NativeDaroModule from '../NativeDaroModule';
16
16
  import type { AdNativeEvent } from '../types/AdEvent';
17
17
  import type { AdInfo, AdLoadFailedInfo } from '../types/AdInfo';
@@ -6,6 +6,23 @@ export type AdInfo = {
6
6
  adUnitId: string;
7
7
  // The total latency in milliseconds for this waterfall to finish processing.
8
8
  latencyMillis: number;
9
+
10
+ /**
11
+ * 이 광고를 서빙한 미디에이션. `"daroa"` 또는 `"darom"`.
12
+ *
13
+ * **열거형이 아니라 문자열이다.** 값이 늘어날 수 있고, 그때 앱이 다시 빌드되지
14
+ * 않아야 한다.
15
+ *
16
+ * 로드 응답이 있어야 알 수 있으므로 요청 시점 이벤트에는 없다.
17
+ */
18
+ mediationPlatform?: string;
19
+
20
+ /**
21
+ * 이 광고를 실제로 채운 네트워크 이름. **벤더 어휘이고 정규화하지 않는다** —
22
+ * AdMob 은 `adSourceName`, AppLovin 은 `networkName` 이 출처다. 보기 좋게
23
+ * 매핑하면 벤더가 이름을 바꿀 때 조용히 틀린 값을 보여준다.
24
+ */
25
+ adNetwork?: string;
9
26
  };
10
27
 
11
28
  // Encapsulates various data for MAX load errors.
@@ -5,8 +5,6 @@ import type { AdInfo } from './AdInfo';
5
5
  export type AdProps = {
6
6
  adUnitId: string;
7
7
 
8
- placement?: string | null;
9
-
10
8
  onAdLoaded?: (adInfo: AdInfo) => void;
11
9
 
12
10
  onAdLoadFailed?: (error: AdLoadFailedInfo) => void;