@igaworks/adbrix-react-native-sdk 1.0.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 (99) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +20 -0
  3. package/README.md +16 -0
  4. package/adbrix-react-native-sdk.podspec +20 -0
  5. package/android/build.gradle +78 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +3 -0
  8. package/android/src/main/AndroidManifestNew.xml +2 -0
  9. package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeParser.java +220 -0
  10. package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkModule.java +166 -0
  11. package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkPackage.java +29 -0
  12. package/babel.config.js +3 -0
  13. package/example/.bundle/config +2 -0
  14. package/example/.watchmanconfig +1 -0
  15. package/example/Gemfile +10 -0
  16. package/example/README.md +106 -0
  17. package/example/android/README.md +24 -0
  18. package/example/android/app/build.gradle +128 -0
  19. package/example/android/app/debug.keystore +0 -0
  20. package/example/android/app/proguard-rules.pro +10 -0
  21. package/example/android/app/src/debug/AndroidManifest.xml +9 -0
  22. package/example/android/app/src/main/AndroidManifest.xml +34 -0
  23. package/example/android/app/src/main/ic_launcher-playstore.png +0 -0
  24. package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainActivity.kt +28 -0
  25. package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainApplication.kt +44 -0
  26. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  27. package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  28. package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  29. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  30. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
  31. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  32. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  33. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
  34. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  35. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  36. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
  37. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  38. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  39. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
  40. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  41. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  42. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
  43. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  44. package/example/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
  45. package/example/android/app/src/main/res/values/strings.xml +3 -0
  46. package/example/android/app/src/main/res/values/styles.xml +9 -0
  47. package/example/android/build.gradle +21 -0
  48. package/example/android/gradle.properties +39 -0
  49. package/example/android/settings.gradle +6 -0
  50. package/example/app.json +4 -0
  51. package/example/babel.config.js +4 -0
  52. package/example/index.js +5 -0
  53. package/example/ios/.xcode.env +11 -0
  54. package/example/ios/AdbrixReactNativeSdkExample/AppDelegate.swift +53 -0
  55. package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  56. package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/Contents.json +6 -0
  57. package/example/ios/AdbrixReactNativeSdkExample/Info.plist +62 -0
  58. package/example/ios/AdbrixReactNativeSdkExample/LaunchScreen.storyboard +47 -0
  59. package/example/ios/AdbrixReactNativeSdkExample/PrivacyInfo.xcprivacy +37 -0
  60. package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/project.pbxproj +488 -0
  61. package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/xcshareddata/xcschemes/AdbrixReactNativeSdkExample.xcscheme +88 -0
  62. package/example/ios/AdbrixReactNativeSdkExample.xcworkspace/contents.xcworkspacedata +10 -0
  63. package/example/ios/Podfile +35 -0
  64. package/example/ios/Podfile.lock +1821 -0
  65. package/example/jest.config.js +3 -0
  66. package/example/metro.config.js +27 -0
  67. package/example/package.json +33 -0
  68. package/example/react-native.config.js +21 -0
  69. package/example/src/App.tsx +755 -0
  70. package/ios/AdbrixPropertiesParser.h +16 -0
  71. package/ios/AdbrixPropertiesParser.m +97 -0
  72. package/ios/AdbrixReactNative.swift +170 -0
  73. package/ios/AdbrixReactNativeSdk.h +11 -0
  74. package/ios/AdbrixReactNativeSdk.m +79 -0
  75. package/ios/AdbrixReactNativeSdk.xcodeproj/project.pbxproj +324 -0
  76. package/lib/commonjs/constants.js +174 -0
  77. package/lib/commonjs/constants.js.map +1 -0
  78. package/lib/commonjs/index.d.js +6 -0
  79. package/lib/commonjs/index.d.js.map +1 -0
  80. package/lib/commonjs/index.js +155 -0
  81. package/lib/commonjs/index.js.map +1 -0
  82. package/lib/commonjs/package.json +1 -0
  83. package/lib/commonjs/properties.js +347 -0
  84. package/lib/commonjs/properties.js.map +1 -0
  85. package/lib/index.d.ts +312 -0
  86. package/lib/module/constants.js +170 -0
  87. package/lib/module/constants.js.map +1 -0
  88. package/lib/module/index.d.js +4 -0
  89. package/lib/module/index.d.js.map +1 -0
  90. package/lib/module/index.js +121 -0
  91. package/lib/module/index.js.map +1 -0
  92. package/lib/module/properties.js +342 -0
  93. package/lib/module/properties.js.map +1 -0
  94. package/package.json +57 -0
  95. package/src/constants.js +175 -0
  96. package/src/index.d.ts +312 -0
  97. package/src/index.js +124 -0
  98. package/src/properties.js +275 -0
  99. package/tsconfig.json +29 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ ## 1.0.0 (2025-06-19)
2
+ <details open>
3
+ <summary>EN</summary>
4
+
5
+ ##### Notes
6
+
7
+ - Initial release.
8
+
9
+ ##### Versions
10
+
11
+ - Android
12
+ - Adbrix Android SDK 3.0.4
13
+ - iOS
14
+ - Adbrix iOS SDK 3.0.2
15
+
16
+ </details>
17
+ <details open>
18
+ <summary>KO</summary>
19
+
20
+ ##### 주요 사항
21
+
22
+ - 최초 배포.
23
+
24
+ ##### 버전 정보
25
+
26
+ - Android
27
+ - Adbrix Android SDK 3.0.4
28
+ - iOS
29
+ - Adbrix iOS SDK 3.0.2
30
+
31
+ </details>
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 IGAWORKS
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # Adbrix React Native SDK
2
+
3
+ This repository contains the the javascript interface and native React Native functionality for the React Native plugins derived from the Adbrix Android and iOS SDKs.
4
+
5
+ - [Adbrix User Guide](https://adbrix.gitbook.io/user-guide)
6
+ - [Adbrix Developer Guide](https://adbrix.gitbook.io/developer-guide/platform/reactnative)
7
+
8
+ ## Dependencies
9
+
10
+ ### Android
11
+ - [com.igaworks.adbrix:android-sdk](./CHANGELOG.md)
12
+ - com.android.installreferrer:installreferrer:2.2
13
+ - com.google.android.gms:play-services-ads-identifier:18.2.0
14
+
15
+ ### iOS
16
+ - [adbrix2.0](./CHANGELOG.md)
@@ -0,0 +1,20 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "adbrix-react-native-sdk"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "12.0" }
14
+ s.source = { :git => package["repository"], :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+
18
+ s.dependency "adbrix2.0", "3.0.2"
19
+ s.dependency "React-Core"
20
+ end
@@ -0,0 +1,78 @@
1
+ buildscript {
2
+ ext.getExtOrDefault = {name ->
3
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['AdbrixReactNativeSdk_' + name]
4
+ }
5
+
6
+ repositories {
7
+ google()
8
+ mavenCentral()
9
+ }
10
+
11
+ dependencies {
12
+ classpath "com.android.tools.build:gradle:7.2.2"
13
+ }
14
+ }
15
+
16
+
17
+ apply plugin: "com.android.library"
18
+
19
+
20
+ def getExtOrIntegerDefault(name) {
21
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AdbrixReactNativeSdk_" + name]).toInteger()
22
+ }
23
+
24
+ def supportsNamespace() {
25
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
26
+ def major = parsed[0].toInteger()
27
+ def minor = parsed[1].toInteger()
28
+
29
+ // Namespace support was added in 7.3.0
30
+ return (major == 7 && minor >= 3) || major >= 8
31
+ }
32
+
33
+ android {
34
+ if (supportsNamespace()) {
35
+ namespace "com.igaworks.adbrixreactnativesdk"
36
+
37
+ sourceSets {
38
+ main {
39
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
40
+ }
41
+ }
42
+ }
43
+
44
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
45
+
46
+ defaultConfig {
47
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
48
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
49
+ }
50
+
51
+ buildTypes {
52
+ release {
53
+ minifyEnabled false
54
+ }
55
+ }
56
+
57
+ lintOptions {
58
+ disable "GradleCompatible"
59
+ }
60
+
61
+ compileOptions {
62
+ sourceCompatibility JavaVersion.VERSION_1_8
63
+ targetCompatibility JavaVersion.VERSION_1_8
64
+ }
65
+ }
66
+
67
+ repositories {
68
+ mavenCentral()
69
+ google()
70
+ }
71
+
72
+ dependencies {
73
+ implementation "com.facebook.react:react-native:+"
74
+ implementation 'com.igaworks.adbrix:android-sdk:3.0.4'
75
+ implementation 'com.android.installreferrer:installreferrer:2.2'
76
+ implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
77
+ }
78
+
@@ -0,0 +1,5 @@
1
+ AdbrixReactNativeSdk_kotlinVersion=2.0.21
2
+ AdbrixReactNativeSdk_minSdkVersion=24
3
+ AdbrixReactNativeSdk_targetSdkVersion=34
4
+ AdbrixReactNativeSdk_compileSdkVersion=35
5
+ AdbrixReactNativeSdk_ndkVersion=27.1.12297006
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.igaworks.adbrixreactnativesdk">
3
+ </manifest>
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,220 @@
1
+ package com.igaworks.adbrixreactnativesdk;
2
+
3
+ import android.util.Log;
4
+
5
+ import com.facebook.react.bridge.Arguments;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.bridge.ReadableArray;
8
+ import com.facebook.react.bridge.ReadableMapKeySetIterator;
9
+ import com.facebook.react.bridge.ReadableType;
10
+ import com.facebook.react.bridge.WritableMap;
11
+
12
+ import org.json.JSONArray;
13
+ import org.json.JSONObject;
14
+
15
+ import java.util.HashMap;
16
+ import java.util.ArrayList;
17
+ import java.util.Map;
18
+ import java.util.List;
19
+
20
+ /**
21
+ * Adbrix Properties Builder 파싱 유틸리티 클래스
22
+ * React Native에서 전달받은 Properties Builder 객체를 네이티브에서 사용할 수 있는 형태로 변환
23
+ */
24
+ public final class AdbrixReactNativeParser {
25
+ private static final String TAG = "AdbrixReactNativeParser";
26
+ /**
27
+ * Properties Builder로 생성된 객체를 파싱하여 실제 값들의 Map을 반환
28
+ * @param propertiesMap React Native에서 전달받은 ReadableMap
29
+ * @return 파싱된 프로퍼티들의 Map<String, Object>
30
+ */
31
+ public static Map<String, Object> parsePropertiesReadableMap(ReadableMap propertiesMap) {
32
+ if (propertiesMap == null) {
33
+ return new HashMap<>();
34
+ }
35
+ Map<String, Object> parsedProperties = new HashMap<>();
36
+ ReadableMapKeySetIterator iterator = propertiesMap.keySetIterator();
37
+
38
+ while (iterator.hasNextKey()) {
39
+ String key = iterator.nextKey();
40
+ Object value = parsePropertyValue(propertiesMap, key);
41
+ if (value != null) {
42
+ parsedProperties.put(key, value);
43
+ }
44
+ }
45
+ return parsedProperties;
46
+ }
47
+
48
+ /**
49
+ * 개별 프로퍼티 값을 파싱
50
+ * @param map 프로퍼티를 포함한 ReadableMap
51
+ * @param key 파싱할 프로퍼티의 키
52
+ * @return 파싱된 값 (타입에 따라 적절히 변환됨)
53
+ */
54
+ private static Object parsePropertyValue(ReadableMap map, String key) {
55
+ try {
56
+ // items 배열 처리
57
+ if ("abx:items".equals(key) && map.hasKey(key)) {
58
+ ReadableArray itemsArray = map.getArray(key);
59
+ if (itemsArray != null) {
60
+ return parseItemsArray(itemsArray);
61
+ }
62
+ return null;
63
+ }
64
+
65
+ // 일반 프로퍼티 처리 (TypedValue 구조)
66
+ if (map.hasKey(key)) {
67
+ ReadableMap typedValue = map.getMap(key);
68
+ if (typedValue != null && typedValue.hasKey("value") && typedValue.hasKey("type")) {
69
+ return parseTypedValue(typedValue);
70
+ }
71
+ }
72
+
73
+ return null;
74
+ } catch (Exception e) {
75
+ return null;
76
+ }
77
+ }
78
+
79
+ /**
80
+ * TypedValue 구조를 파싱하여 실제 값을 반환
81
+ * @param typedValue { value: any, type: string } 구조의 ReadableMap
82
+ * @return 타입에 맞게 변환된 실제 값
83
+ */
84
+ private static Object parseTypedValue(ReadableMap typedValue) {
85
+ String type = typedValue.getString("type");
86
+
87
+ switch (type) {
88
+ case "string":
89
+ return typedValue.getString("value");
90
+ case "long":
91
+ return typedValue.hasKey("value") ? (long) typedValue.getDouble("value") : 0L;
92
+ case "double":
93
+ return typedValue.getDouble("value");
94
+ case "boolean":
95
+ return typedValue.getBoolean("value");
96
+ default:
97
+ return typedValue.getString("value");
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Items 배열을 파싱
103
+ * @param itemsArray items 배열
104
+ * @return 파싱된 아이템들의 리스트
105
+ */
106
+ private static List<Map<String, Object>> parseItemsArray(ReadableArray itemsArray) {
107
+ List<Map<String, Object>> items = new ArrayList<>();
108
+
109
+ for (int i = 0; i < itemsArray.size(); i++) {
110
+ ReadableMap itemMap = itemsArray.getMap(i);
111
+ if (itemMap != null) {
112
+ Map<String, Object> parsedItem = parseItem(itemMap);
113
+ items.add(parsedItem);
114
+ }
115
+ }
116
+
117
+
118
+ return items;
119
+ }
120
+
121
+ /**
122
+ * 개별 아이템을 파싱
123
+ * @param itemMap 아이템 ReadableMap
124
+ * @return 파싱된 아이템 Map
125
+ */
126
+ private static Map<String, Object> parseItem(ReadableMap itemMap) {
127
+ Map<String, Object> parsedItem = new HashMap<>();
128
+ ReadableMapKeySetIterator iterator = itemMap.keySetIterator();
129
+ while (iterator.hasNextKey()) {
130
+ String key = iterator.nextKey();
131
+ ReadableMap typedValue = itemMap.getMap(key);
132
+ if (typedValue != null && typedValue.hasKey("value") && typedValue.hasKey("type")) {
133
+ Object value = parseTypedValue(typedValue);
134
+ if (value != null) {
135
+ parsedItem.put(key, value);
136
+ }
137
+ }
138
+ }
139
+
140
+ return parsedItem;
141
+ }
142
+
143
+ public static ReadableMap convertToReadableMap(HashMap<Object, Object> hashMap) {
144
+ WritableMap writableMap = Arguments.createMap();
145
+ for (Map.Entry<Object, Object> entry : hashMap.entrySet()) {
146
+ Object key = entry.getKey();
147
+ Object value = entry.getValue();
148
+
149
+ if (value instanceof String) {
150
+ writableMap.putString(key.toString(), (String) value);
151
+ } else if (value instanceof Integer || value instanceof Long) {
152
+ writableMap.putInt(key.toString(), (int) value);
153
+ } else if (value instanceof Boolean) {
154
+ writableMap.putBoolean(key.toString(), (Boolean) value);
155
+ } else if (value instanceof Double || value instanceof Float) {
156
+ writableMap.putDouble(key.toString(), (double) value);
157
+ } else {
158
+ writableMap.putString(key.toString(), value.toString());
159
+ }
160
+ }
161
+ return writableMap;
162
+ }
163
+
164
+ public static JSONObject convertReadableMapToJson(ReadableMap readableMap) {
165
+ JSONObject jsonObject = new JSONObject();
166
+ ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
167
+ while (iterator.hasNextKey()) {
168
+ String key = iterator.nextKey();
169
+ try {
170
+ switch (readableMap.getType(key)) {
171
+ case Null:
172
+ jsonObject.put(key, JSONObject.NULL);
173
+ break;
174
+ case Boolean:
175
+ jsonObject.put(key, readableMap.getBoolean(key));
176
+ break;
177
+ case Number:
178
+ jsonObject.put(key, readableMap.getDouble(key));
179
+ break;
180
+ case String:
181
+ jsonObject.put(key, readableMap.getString(key));
182
+ break;
183
+ case Array:
184
+ jsonObject.put(key, convertReadableArrayToJson(readableMap.getArray(key)));
185
+ break;
186
+ default:
187
+ Log.d(TAG, "Could not convert object with key: " + key + ".");
188
+ }
189
+ } catch (Exception e) {
190
+ Log.w(TAG, e);
191
+ }
192
+ }
193
+ return jsonObject;
194
+ }
195
+ public static JSONArray convertReadableArrayToJson(ReadableArray readableArray) {
196
+ JSONArray jsonArray = new JSONArray();
197
+ for (int i = 0; i < readableArray.size(); i++) {
198
+ ReadableType type = readableArray.getType(i);
199
+ try {
200
+ switch (type) {
201
+ case Null:
202
+ jsonArray.put(JSONObject.NULL);
203
+ break;
204
+ case Number:
205
+ jsonArray.put(readableArray.getDouble(i));
206
+ break;
207
+ case String:
208
+ jsonArray.put(readableArray.getString(i));
209
+ break;
210
+ case Map:
211
+ jsonArray.put(convertReadableMapToJson(readableArray.getMap(i)));
212
+ break;
213
+ }
214
+ } catch (Exception e) {
215
+ Log.w(TAG, e);
216
+ }
217
+ }
218
+ return jsonArray;
219
+ }
220
+ }
@@ -0,0 +1,166 @@
1
+ package com.igaworks.adbrixreactnativesdk;
2
+
3
+ import android.util.Log;
4
+
5
+ import androidx.annotation.NonNull;
6
+
7
+ import com.facebook.react.bridge.LifecycleEventListener;
8
+ import com.facebook.react.bridge.Promise;
9
+ import com.facebook.react.bridge.ReactApplicationContext;
10
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
11
+ import com.facebook.react.bridge.ReactMethod;
12
+ import com.facebook.react.bridge.ReadableMap;
13
+ import com.igaworks.adbrix.Adbrix;
14
+ import com.igaworks.adbrix.AdbrixBridge;
15
+
16
+ import org.json.JSONObject;
17
+
18
+ import java.util.HashMap;
19
+ import java.util.Map;
20
+
21
+ public class AdbrixReactNativeSdkModule extends ReactContextBaseJavaModule implements LifecycleEventListener{
22
+
23
+ public static final String NAME = "Adbrix";
24
+ private static final String TAG = "abx_AdbrixReactNativeSdkModule";
25
+ private final AdbrixBridge adbrixBridge;
26
+
27
+ public AdbrixReactNativeSdkModule(ReactApplicationContext context) {
28
+ super(context);
29
+ this.adbrixBridge = AdbrixBridge.getInstance();
30
+ this.adbrixBridge.registerAdbrixDeferredDeepLinkListener(0);
31
+ }
32
+
33
+ @Override
34
+ public void initialize() {
35
+ super.initialize();
36
+ Log.i(TAG, "initialize");
37
+ getReactApplicationContext().addLifecycleEventListener(this);
38
+ }
39
+
40
+ @Override
41
+ public void invalidate() {
42
+ super.invalidate();
43
+ Log.i(TAG, "invalidate");
44
+ getReactApplicationContext().removeLifecycleEventListener(this);
45
+ }
46
+
47
+ @Override
48
+ public void onHostResume() {
49
+ Log.i(TAG, "onHostResume");
50
+ if(getCurrentActivity() != null){
51
+ adbrixBridge.startSession(getCurrentActivity());
52
+ }
53
+ }
54
+
55
+ @Override
56
+ public void onHostPause() {
57
+ Log.i(TAG, "onHostPause");
58
+ if(getCurrentActivity() != null){
59
+ adbrixBridge.endSession(getCurrentActivity());
60
+ }
61
+ }
62
+
63
+ @Override
64
+ public void onHostDestroy() {
65
+ Log.i(TAG, "onHostDestroy");
66
+ }
67
+
68
+ @Override
69
+ @NonNull
70
+ public String getName() {
71
+ return NAME;
72
+ }
73
+
74
+ // =============================================================================
75
+ // Adbrix 메인 API 메서드들
76
+ // =============================================================================
77
+
78
+
79
+ // SDK 초기화
80
+ @ReactMethod
81
+ public void init(ReadableMap params) {
82
+ String applicationKey = params.getString("applicationKey");
83
+ String secretKey = params.getString("secretKey");
84
+
85
+ Log.d(TAG, "🚀 init - applicationKey: " + applicationKey + ", secretKey: " + secretKey);
86
+
87
+ adbrixBridge.init(getReactApplicationContext(), applicationKey, secretKey);
88
+ }
89
+
90
+ // 설정과 함께 SDK 초기화
91
+ @ReactMethod
92
+ public void initWithConfig(ReadableMap params) {
93
+ String applicationKey = params.getString("applicationKey");
94
+ String secretKey = params.getString("secretKey");
95
+ ReadableMap config = params.getMap("config");
96
+ if(config != null){
97
+ JSONObject configJsonObject = AdbrixReactNativeParser.convertReadableMapToJson(config);
98
+ Log.d(TAG, "🚀 initWithConfig - applicationKey: " + applicationKey + ", secretKey: " + secretKey + ", config: " + configJsonObject);
99
+ adbrixBridge.init(getReactApplicationContext(), applicationKey, secretKey, configJsonObject.toString());
100
+ } else{
101
+ Log.d(TAG, "🚀 init - applicationKey: " + applicationKey + ", secretKey: " + secretKey);
102
+ adbrixBridge.init(getReactApplicationContext(), applicationKey, secretKey);
103
+ }
104
+ }
105
+
106
+ // 이벤트 로깅
107
+ @ReactMethod
108
+ public void logEvent(ReadableMap params) {
109
+ String eventName = params.getString("eventName");
110
+ ReadableMap properties = params.getMap("properties");
111
+
112
+ if(eventName == null){
113
+ Log.d(TAG, "eventName is null");
114
+ return;
115
+ }
116
+
117
+ // Properties Builder 객체 파싱
118
+ if (properties != null) {
119
+ Map<String, Object> parsedProperties = AdbrixReactNativeParser.parsePropertiesReadableMap(properties);
120
+ JSONObject propertiesJsonObject = new JSONObject(parsedProperties);
121
+ Log.d(TAG, "📊 logEvent - eventName: " + eventName+" properties: "+propertiesJsonObject);
122
+ Adbrix.getInstance().logEvent(eventName, propertiesJsonObject);
123
+ } else{
124
+ Log.d(TAG, "📊 logEvent - eventName: " + eventName+" properties: null");
125
+ Adbrix.getInstance().logEvent(eventName);
126
+ }
127
+ }
128
+
129
+ // SDK 활성화
130
+ @ReactMethod
131
+ public void enableSDK() {
132
+ Log.d(TAG, "✅ enableSDK");
133
+ Adbrix.getInstance().enableSDK();
134
+ }
135
+
136
+ // SDK 비활성화
137
+ @ReactMethod
138
+ public void disableSDK() {
139
+ Log.d(TAG, "❌ disableSDK");
140
+ Adbrix.getInstance().disableSDK();
141
+ }
142
+
143
+ // 지연된 딥링크 실행 차단
144
+ @ReactMethod
145
+ public void blockDeferredDeepLinkLaunch(Promise promise) {
146
+ Log.d(TAG, "🔗 blockDeferredDeepLinkLaunch");
147
+
148
+ adbrixBridge.blockDeferredDeepLinkLaunch(new AdbrixBridge.AdbrixDeferredDeepLinkCallback() {
149
+ @Override
150
+ public void onCallback(int result, String deepLink) {
151
+ HashMap<Object, Object> map = new HashMap<>();
152
+ map.put("result", result);
153
+ map.put("deepLink", deepLink);
154
+ promise.resolve(AdbrixReactNativeParser.convertToReadableMap(map));
155
+ }
156
+ });
157
+ }
158
+
159
+ // ATT 권한 상태 설정 (Android에서는 no-op)
160
+ @ReactMethod
161
+ public void attAuthorized(ReadableMap params) {
162
+ boolean authorized = params.getBoolean("authorized");
163
+
164
+ Log.d(TAG, "🔐 attAuthorized - authorized: " + authorized + " (Android에서는 무시됨)");
165
+ }
166
+ }
@@ -0,0 +1,29 @@
1
+ package com.igaworks.adbrixreactnativesdk;
2
+
3
+ import com.facebook.react.ReactPackage;
4
+ import com.facebook.react.bridge.NativeModule;
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.uimanager.ViewManager;
7
+
8
+ import java.util.ArrayList;
9
+ import java.util.Collections;
10
+ import java.util.List;
11
+
12
+ import androidx.annotation.NonNull;
13
+
14
+ public class AdbrixReactNativeSdkPackage implements ReactPackage {
15
+
16
+ @NonNull
17
+ @Override
18
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
19
+ List<NativeModule> modules = new ArrayList<>();
20
+ modules.add(new AdbrixReactNativeSdkModule(reactContext));
21
+ return modules;
22
+ }
23
+
24
+ @NonNull
25
+ @Override
26
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
27
+ return Collections.emptyList();
28
+ }
29
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['module:react-native-builder-bob/babel-preset'],
3
+ };
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby ">= 2.6.10"
5
+
6
+ # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7
+ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8
+ gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9
+ gem 'xcodeproj', '< 1.26.0'
10
+ gem 'concurrent-ruby', '< 1.3.4'