tagworks-sdk-v1-react 1.1.22 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/tagworkssdkv1/OnCmsBannerView.kt +68 -0
- package/android/src/main/java/com/tagworkssdkv1/OnCmsBannerViewManager.kt +23 -51
- package/ios/OnCMSBannerViewManagerBridge.m +3 -2
- package/ios/OnCmsBannerViewManager.swift +144 -42
- package/ios/TagWorksModule.swift +10 -33
- package/ios/TagWorksModuleBridge.m +9 -9
- package/lib/commonjs/OnCmsBannerCommands.js +30 -0
- package/lib/commonjs/OnCmsBannerCommands.js.map +1 -0
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/OnCmsBannerCommands.js +25 -0
- package/lib/module/OnCmsBannerCommands.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.d.ts +19 -0
- package/lib/typescript/commonjs/android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/OnCmsBannerCommands.d.ts +2 -0
- package/lib/typescript/commonjs/src/OnCmsBannerCommands.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.d.ts +19 -0
- package/lib/typescript/module/android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.d.ts.map +1 -0
- package/lib/typescript/module/src/OnCmsBannerCommands.d.ts +2 -0
- package/lib/typescript/module/src/OnCmsBannerCommands.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +13 -15
- package/src/OnCmsBannerCommands.js +31 -0
- package/src/index.js +2 -1
- package/tagworks-sdk-v1-react.podspec +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
package com.tagworkssdkv1
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.widget.FrameLayout
|
|
5
|
+
import com.obzen.tagworks.TagWorksPopup
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OnCmsBannerView(
|
|
9
|
+
context: Context
|
|
10
|
+
) : FrameLayout(context){
|
|
11
|
+
|
|
12
|
+
private var onCmsUrl: String? = null
|
|
13
|
+
private var custId: String?= null
|
|
14
|
+
private var rcmdAreaCd: String? = null
|
|
15
|
+
private var defaultImageRes: Int? = null
|
|
16
|
+
|
|
17
|
+
private var isAttached = false
|
|
18
|
+
|
|
19
|
+
override fun onDetachedFromWindow() {
|
|
20
|
+
super.onDetachedFromWindow()
|
|
21
|
+
removeAllViews()
|
|
22
|
+
isAttached = false
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
|
26
|
+
super.onSizeChanged(w, h, oldw, oldh)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fun setOnCmsUrl(url: String) {
|
|
30
|
+
onCmsUrl = url
|
|
31
|
+
tryAttach()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun setCustId(id: String?) {
|
|
35
|
+
custId = id
|
|
36
|
+
tryAttach()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
fun setRcmdAreaCd(code: String) {
|
|
40
|
+
rcmdAreaCd = code
|
|
41
|
+
tryAttach()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fun setDefaultImage(resId: Int) {
|
|
45
|
+
defaultImageRes = resId
|
|
46
|
+
tryAttach()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private fun tryAttach() {
|
|
50
|
+
if(
|
|
51
|
+
isAttached ||
|
|
52
|
+
onCmsUrl.isNullOrEmpty() ||
|
|
53
|
+
rcmdAreaCd.isNullOrEmpty() ||
|
|
54
|
+
defaultImageRes == null
|
|
55
|
+
) return
|
|
56
|
+
|
|
57
|
+
isAttached = true
|
|
58
|
+
|
|
59
|
+
TagWorksPopup.onCMSPopupBanner(
|
|
60
|
+
onCmsUrl = onCmsUrl!!,
|
|
61
|
+
cust_id = custId,
|
|
62
|
+
rcmd_area_cd = rcmdAreaCd!!,
|
|
63
|
+
bannerView = this,
|
|
64
|
+
context = context,
|
|
65
|
+
defaultImage = defaultImageRes!!
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,82 +1,54 @@
|
|
|
1
1
|
package com.tagworkssdkv1
|
|
2
2
|
|
|
3
|
-
import android.widget.FrameLayout
|
|
4
|
-
import com.facebook.react.bridge.ReactContext
|
|
5
3
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
4
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
5
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
-
|
|
6
|
+
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* React Native에서 사용할 수 있는 커스텀 네이티브 View를 정의하는 ViewManager 클래스
|
|
12
10
|
* FrameLayout을 기반으로 하며, 외부에서 전달된 props를 통해 배너를 갱신.
|
|
13
11
|
* Created by obzen on 2025-04-23
|
|
14
12
|
*/
|
|
15
|
-
class OnCmsBannerViewManager: SimpleViewManager<
|
|
13
|
+
class OnCmsBannerViewManager: SimpleViewManager<OnCmsBannerView>() {
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private var defaultImage: String = ""
|
|
15
|
+
override fun getName(): String {
|
|
16
|
+
return "OnCmsBannerView"
|
|
17
|
+
}
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
20
|
* 실제 Native View를 생성하는 함수.
|
|
24
21
|
* React Native에서 <OnCmsBannerView />를 선언하면 호출.
|
|
25
22
|
*/
|
|
26
|
-
override fun createViewInstance(reactContext: ThemedReactContext):
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return frameLayout
|
|
23
|
+
override fun createViewInstance(reactContext: ThemedReactContext): OnCmsBannerView {
|
|
24
|
+
return OnCmsBannerView(reactContext)
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
@ReactProp(name = "onCmsUrl")
|
|
33
|
-
fun setOnCmsUrl(view:
|
|
34
|
-
|
|
35
|
-
attachBanner(view)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@ReactProp(name = "rcmd_area_cd")
|
|
39
|
-
fun setRcmdAreaCd(view: FrameLayout, areaCd: String) {
|
|
40
|
-
rcmdAreaCd = areaCd
|
|
41
|
-
attachBanner(view)
|
|
28
|
+
fun setOnCmsUrl(view: OnCmsBannerView,url: String) {
|
|
29
|
+
view.setOnCmsUrl(url)
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
@ReactProp(name = "cust_id")
|
|
45
|
-
fun setCustId(view:
|
|
46
|
-
|
|
47
|
-
attachBanner(view)
|
|
33
|
+
fun setCustId(view: OnCmsBannerView, id: String?) {
|
|
34
|
+
view.setCustId(id)
|
|
48
35
|
}
|
|
49
36
|
|
|
50
|
-
@ReactProp(name = "
|
|
51
|
-
fun
|
|
52
|
-
|
|
53
|
-
attachBanner(view)
|
|
37
|
+
@ReactProp(name = "rcmd_area_cd")
|
|
38
|
+
fun setRcmdAreaCd(view: OnCmsBannerView, code:String) {
|
|
39
|
+
view.setRcmdAreaCd(code)
|
|
54
40
|
}
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
val context = container.context
|
|
63
|
-
val activity = (context as? ReactContext)?.currentActivity
|
|
64
|
-
|
|
65
|
-
val resId = activity?.resources?.getIdentifier(defaultImage, "drawable", activity.packageName)
|
|
66
|
-
|
|
67
|
-
if (resId != null) {
|
|
68
|
-
TagWorksPopup.onCMSPopupBanner(
|
|
69
|
-
onCmsUrl = onCmsUrl,
|
|
70
|
-
cust_id = custId,
|
|
71
|
-
rcmd_area_cd = rcmdAreaCd,
|
|
72
|
-
context = context,
|
|
73
|
-
bannerView = container,
|
|
74
|
-
defaultImage = resId
|
|
42
|
+
@ReactProp(name = "defaultImage")
|
|
43
|
+
fun setDefaultImage(view: OnCmsBannerView, imageName: String) {
|
|
44
|
+
val resId = view.context.resources.getIdentifier(
|
|
45
|
+
imageName,
|
|
46
|
+
"drawable",
|
|
47
|
+
view.context.packageName
|
|
75
48
|
)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
49
|
|
|
79
|
-
|
|
80
|
-
|
|
50
|
+
if (resId != 0) {
|
|
51
|
+
view.setDefaultImage(resId)
|
|
52
|
+
}
|
|
81
53
|
}
|
|
82
54
|
}
|
|
@@ -15,6 +15,7 @@ RCT_EXPORT_VIEW_PROPERTY(rcmd_area_cd, NSString)
|
|
|
15
15
|
RCT_EXPORT_VIEW_PROPERTY(cust_id, NSString)
|
|
16
16
|
RCT_EXPORT_VIEW_PROPERTY(defaultImage, NSString)
|
|
17
17
|
|
|
18
|
-
//
|
|
19
|
-
|
|
18
|
+
// JS에서 호출할 명령 정의
|
|
19
|
+
// RCT_EXTERN_METHOD(setOnCmsBannerParam:(nonnull NSNumber *)reactTag params:(NSDictionary *)params)
|
|
20
|
+
// RCT_EXTERN_METHOD(setOnCmsBannerParam:(NSNumber *) reactTag url:(NSString *)url custId:(NSString *)custId areaCd:(NSString *)areaCd defaultImage:(NSString *)defaultImage)
|
|
20
21
|
@end
|
|
@@ -18,6 +18,36 @@ class OnCmsBannerViewManager: RCTViewManager {
|
|
|
18
18
|
override func view() -> UIView! {
|
|
19
19
|
return OnCmsBannerView()
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
override func constantsToExport() -> [AnyHashable : Any]! {
|
|
23
|
+
return ["Commands": ["attach": 0]]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@objc(setOnCmsBannerParam:params:)
|
|
28
|
+
func setOnCmsBannerParam(_ reactTag: NSNumber, params: [String: Any]) {
|
|
29
|
+
self.bridge.uiManager.addUIBlock { (uiManager, viewRegistry) in
|
|
30
|
+
// reactTag를 이용해 실제 View 인스턴스를 찾음
|
|
31
|
+
if let view = viewRegistry?[reactTag] as? OnCmsBannerView {
|
|
32
|
+
let onCmsUrl = params["onCmsUrl"] as? String
|
|
33
|
+
let cust_id = params["cust_id"] as? String
|
|
34
|
+
let rcmd_area_cd = params["rcmd_area_cd"] as? String
|
|
35
|
+
let defaultImage = params["defaultImage"] as? String
|
|
36
|
+
|
|
37
|
+
// Native View 업데이트
|
|
38
|
+
// view.updateBanner(custId: custId, areaCode: areaCode)
|
|
39
|
+
view.onCMSPopupBanner(
|
|
40
|
+
onCmsUrl: onCmsUrl ?? "",
|
|
41
|
+
cust_id: cust_id ?? "",
|
|
42
|
+
rcmd_area_cd: rcmd_area_cd ?? "",
|
|
43
|
+
defaultImage: defaultImage ?? ""
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
view.setNeedsLayout()
|
|
47
|
+
view.layoutIfNeeded()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
21
51
|
|
|
22
52
|
// @objc func setOnCmsBannerParam(_ reactTag: NSNumber, url: String, custId: String, areaCd: String, defaultImage: String) {
|
|
23
53
|
// DispatchQueue.main.async {
|
|
@@ -30,7 +60,7 @@ class OnCmsBannerViewManager: RCTViewManager {
|
|
|
30
60
|
// }
|
|
31
61
|
}
|
|
32
62
|
|
|
33
|
-
|
|
63
|
+
@objc(OnCmsBannerView)
|
|
34
64
|
class OnCmsBannerView: UIView {
|
|
35
65
|
|
|
36
66
|
private var onCmsUrlProp: String = ""
|
|
@@ -39,6 +69,11 @@ class OnCmsBannerView: UIView {
|
|
|
39
69
|
private var defaultImageProp: String = ""
|
|
40
70
|
|
|
41
71
|
private var shouldAttachBanner = false
|
|
72
|
+
|
|
73
|
+
private var isReady: Bool {
|
|
74
|
+
return !(self.onCmsUrlProp.isEmpty) && !(self.rcmdAreaCdProp.isEmpty)
|
|
75
|
+
// return true
|
|
76
|
+
}
|
|
42
77
|
|
|
43
78
|
override init(frame: CGRect) {
|
|
44
79
|
super.init(frame: frame)
|
|
@@ -46,73 +81,140 @@ class OnCmsBannerView: UIView {
|
|
|
46
81
|
}
|
|
47
82
|
|
|
48
83
|
required init?(coder: NSCoder) {
|
|
49
|
-
|
|
84
|
+
super.init(coder: coder)
|
|
85
|
+
// fatalError("init(coder:) has not been implemented")
|
|
86
|
+
self.backgroundColor = .clear
|
|
50
87
|
}
|
|
51
|
-
|
|
88
|
+
|
|
52
89
|
override func layoutSubviews() {
|
|
53
90
|
super.layoutSubviews()
|
|
54
91
|
print("layout Size : \(self.frame.size)")
|
|
55
|
-
|
|
92
|
+
|
|
56
93
|
if shouldAttachBanner && self.frame.size != .zero {
|
|
57
94
|
attachBanner()
|
|
58
95
|
shouldAttachBanner = false // 한 번만 실행되도록
|
|
59
96
|
}
|
|
60
97
|
}
|
|
61
|
-
|
|
62
|
-
private var isReady: Bool {
|
|
63
|
-
// return !onCmsUrlProp.isEmpty && !rcmdAreaCdProp.isEmpty && !custIdProp.isEmpty
|
|
64
|
-
// return !onCmsUrlProp.isEmpty && !rcmdAreaCdProp.isEmpty
|
|
65
|
-
return true
|
|
66
|
-
}
|
|
67
98
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
99
|
+
// Android: setOnCmsUrl
|
|
100
|
+
@objc func setOnCmsUrl(_ url: String) {
|
|
101
|
+
self.onCmsUrlProp = url
|
|
102
|
+
checkAndAttach()
|
|
73
103
|
}
|
|
74
104
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
105
|
+
// Android: setCustId
|
|
106
|
+
@objc func setCust_id(_ id: String?) {
|
|
107
|
+
self.custIdProp = id
|
|
108
|
+
checkAndAttach()
|
|
80
109
|
}
|
|
81
110
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
111
|
+
// Android: setRcmdAreaCd
|
|
112
|
+
@objc func setRcmd_area_cd(_ code: String) {
|
|
113
|
+
self.rcmdAreaCdProp = code
|
|
114
|
+
checkAndAttach()
|
|
87
115
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
116
|
+
|
|
117
|
+
// Android: setDefaultImage
|
|
118
|
+
@objc func setDefaultImage(_ imageName: String) {
|
|
119
|
+
self.defaultImageProp = imageName
|
|
120
|
+
checkAndAttach()
|
|
94
121
|
}
|
|
95
|
-
|
|
122
|
+
|
|
96
123
|
private func checkAndAttach() {
|
|
97
124
|
if isReady {
|
|
98
|
-
|
|
125
|
+
attachBanner()
|
|
99
126
|
shouldAttachBanner = true
|
|
100
127
|
setNeedsLayout() // layoutSubviews 호출 유도
|
|
101
128
|
}
|
|
102
129
|
}
|
|
103
130
|
|
|
131
|
+
|
|
104
132
|
private func attachBanner() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
shouldAttachBanner = true
|
|
134
|
+
|
|
135
|
+
TagWorksPopup.sharedInstance.onCMSPopupBanner(
|
|
136
|
+
onCmsUrl: onCmsUrlProp,
|
|
137
|
+
cust_id: custIdProp ?? "",
|
|
138
|
+
rcmd_area_cd: rcmdAreaCdProp,
|
|
139
|
+
bannerView: self,
|
|
140
|
+
defaultPngImageName: defaultImageProp
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
func onCMSPopupBanner(onCmsUrl: String,
|
|
145
|
+
cust_id: String,
|
|
146
|
+
rcmd_area_cd: String,
|
|
147
|
+
defaultImage: String) {
|
|
148
|
+
|
|
149
|
+
self.onCmsUrlProp = onCmsUrl
|
|
150
|
+
self.custIdProp = cust_id
|
|
151
|
+
self.rcmdAreaCdProp = rcmd_area_cd
|
|
152
|
+
self.defaultImageProp = defaultImage
|
|
108
153
|
|
|
109
|
-
|
|
110
|
-
TagWorksPopup.sharedInstance.onCMSPopupBanner(onCmsUrl: onCmsUrlProp,
|
|
111
|
-
cust_id: custIdProp ?? "",
|
|
112
|
-
rcmd_area_cd: rcmdAreaCdProp,
|
|
113
|
-
bannerView: self,
|
|
114
|
-
defaultPngImageName: defaultImageProp)
|
|
154
|
+
attachBanner()
|
|
115
155
|
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// private var isReady: Bool {
|
|
161
|
+
// // return !onCmsUrlProp.isEmpty && !rcmdAreaCdProp.isEmpty && !custIdProp.isEmpty
|
|
162
|
+
// // return !onCmsUrlProp.isEmpty && !rcmdAreaCdProp.isEmpty
|
|
163
|
+
// return true
|
|
164
|
+
// }
|
|
165
|
+
|
|
166
|
+
// @objc func attachBannerFromJS() {
|
|
167
|
+
// attachBanner()
|
|
168
|
+
// }
|
|
169
|
+
|
|
170
|
+
// @objc var onCmsUrl: NSString = "" {
|
|
171
|
+
// didSet {
|
|
172
|
+
// onCmsUrlProp = onCmsUrl as String
|
|
173
|
+
// checkAndAttach()
|
|
174
|
+
// }
|
|
175
|
+
// }
|
|
176
|
+
|
|
177
|
+
// @objc var rcmd_area_cd: String = "" {
|
|
178
|
+
// didSet {
|
|
179
|
+
// rcmdAreaCdProp = rcmd_area_cd
|
|
180
|
+
// checkAndAttach()
|
|
181
|
+
// }
|
|
182
|
+
// }
|
|
183
|
+
|
|
184
|
+
// @objc var cust_id: String = "" {
|
|
185
|
+
// didSet {
|
|
186
|
+
// custIdProp = cust_id
|
|
187
|
+
// checkAndAttach()
|
|
188
|
+
// }
|
|
189
|
+
// }
|
|
190
|
+
|
|
191
|
+
// @objc var defaultImage: String = "" {
|
|
192
|
+
// didSet {
|
|
193
|
+
// defaultImageProp = defaultImage
|
|
194
|
+
// checkAndAttach()
|
|
195
|
+
// }
|
|
196
|
+
// }
|
|
197
|
+
|
|
198
|
+
// private func checkAndAttach() {
|
|
199
|
+
// if isReady {
|
|
200
|
+
// // attachBanner()
|
|
201
|
+
// shouldAttachBanner = true
|
|
202
|
+
// setNeedsLayout() // layoutSubviews 호출 유도
|
|
203
|
+
// }
|
|
204
|
+
// }
|
|
205
|
+
|
|
206
|
+
// private func attachBanner() {
|
|
207
|
+
// // guard !onCmsUrlProp.isEmpty, !rcmdAreaCdProp.isEmpty else {
|
|
208
|
+
// // return
|
|
209
|
+
// // }
|
|
210
|
+
//
|
|
211
|
+
// // TagWorks SDK가 제공하는 iOS 메서드 사용
|
|
212
|
+
// TagWorksPopup.sharedInstance.onCMSPopupBanner(onCmsUrl: onCmsUrlProp,
|
|
213
|
+
// cust_id: custIdProp ?? "",
|
|
214
|
+
// rcmd_area_cd: rcmdAreaCdProp,
|
|
215
|
+
// bannerView: self,
|
|
216
|
+
// defaultPngImageName: defaultImageProp)
|
|
217
|
+
// }
|
|
116
218
|
|
|
117
219
|
|
|
118
220
|
|
package/ios/TagWorksModule.swift
CHANGED
|
@@ -37,29 +37,6 @@ class TagWorksModule: NSObject, RCTBridgeModule {
|
|
|
37
37
|
//=================================
|
|
38
38
|
|
|
39
39
|
// MARK: SDK 초기화
|
|
40
|
-
@objc func initializeTagWorks(_ siteId: String,
|
|
41
|
-
baseUrl: String,
|
|
42
|
-
isUseIntervals: Bool,
|
|
43
|
-
dispatchInterval: TimeInterval = 5.0,
|
|
44
|
-
sessionTimeOut: TimeInterval = 5.0,
|
|
45
|
-
isManualDispatch: Bool = false,
|
|
46
|
-
appVersion: String? = nil,
|
|
47
|
-
appName: String? = nil,
|
|
48
|
-
isUseDynamicParameter: Bool = false) {
|
|
49
|
-
|
|
50
|
-
TagWorks.sharedInstance.setInstanceConfig(siteId: siteId,
|
|
51
|
-
baseUrl: URL(string: baseUrl)!,
|
|
52
|
-
isUseIntervals: isUseIntervals,
|
|
53
|
-
dispatchInterval: dispatchInterval,
|
|
54
|
-
sessionTimeOut: sessionTimeOut,
|
|
55
|
-
// userAgent: userAgent,
|
|
56
|
-
userAgent: nil,
|
|
57
|
-
isManualDispatch: isManualDispatch,
|
|
58
|
-
appVersion: appVersion,
|
|
59
|
-
appName: appName,
|
|
60
|
-
isUseDynamicParameter: isUseDynamicParameter)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
40
|
@objc func initializeTagWorks(_ siteId: String,
|
|
64
41
|
baseUrl: String,
|
|
65
42
|
isUseIntervals: Bool,
|
|
@@ -79,16 +56,16 @@ class TagWorksModule: NSObject, RCTBridgeModule {
|
|
|
79
56
|
}
|
|
80
57
|
|
|
81
58
|
TagWorks.sharedInstance.setInstanceConfig(siteId: siteId,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
59
|
+
baseUrl: URL(string: baseUrl)!,
|
|
60
|
+
isUseIntervals: isUseIntervals,
|
|
61
|
+
dispatchIntervalWithSeconds: dispatchIntervalWithSeconds,
|
|
62
|
+
sessionTimeOutWithSeconds: sessionTimeOutWithSeconds,
|
|
63
|
+
isManualDispatch: isManualDispatch,
|
|
64
|
+
appVersion: appVersion,
|
|
65
|
+
appName: appName,
|
|
66
|
+
isUseDynamicParameter: isUseDynamicParameter,
|
|
67
|
+
isEnabledAdId: false,
|
|
68
|
+
deeplinkServerUrl: deepLinkServerUrl)
|
|
92
69
|
}
|
|
93
70
|
|
|
94
71
|
@objc func setIsDebugPrint(_ value: Bool) {
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
@interface RCT_EXTERN_MODULE(TagWorksModule, NSObject)
|
|
13
13
|
|
|
14
|
-
RCT_EXTERN_METHOD(initializeTagWorks:(NSString *)siteId
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
// RCT_EXTERN_METHOD(initializeTagWorks:(NSString *)siteId
|
|
15
|
+
// baseUrl:(NSString *)baseUrl
|
|
16
|
+
// isUseIntervals:(BOOL)isUseIntervals
|
|
17
|
+
// dispatchInterval:(NSTimeInterval)dispatchInterval
|
|
18
|
+
// sessionTimeOut:(NSTimeInterval)sessionTimeOut
|
|
19
|
+
// isManualDispatch:(BOOL)isManualDispatch
|
|
20
|
+
// appVersion:(NSString *)appVersion
|
|
21
|
+
// appName:(NSString *)appName
|
|
22
|
+
// isUseDynamicParameter:(BOOL)isUseDynamicParameter)
|
|
23
23
|
|
|
24
24
|
RCT_EXTERN_METHOD(initializeTagWorks:(NSString *)siteId
|
|
25
25
|
baseUrl:(NSString *)baseUrl
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.attachBanner = attachBanner;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
// OnCmsBannerCommands.js
|
|
9
|
+
|
|
10
|
+
const VIEW_NAME = 'OnCmsBannerView';
|
|
11
|
+
function attachBanner(ref, params) {
|
|
12
|
+
console.log('🟡 attachBannerRef:', ref);
|
|
13
|
+
console.log('🟡 attachBannerParams:', params);
|
|
14
|
+
const tag = (0, _reactNative.findNodeHandle)(ref.current);
|
|
15
|
+
if (!tag) return;
|
|
16
|
+
|
|
17
|
+
// 'VIEW_NAME'에 해당하는 네이티브 ViewManager 정보 조회
|
|
18
|
+
const config = _reactNative.UIManager.getViewManagerConfig(VIEW_NAME);
|
|
19
|
+
// console.log('🟡 ViewManagerConfig:', config);
|
|
20
|
+
// const commandId = config.Commands.setOnCmsBannerParam;
|
|
21
|
+
const commandId = config?.Constants?.Commands?.setOnCmsBannerParam;
|
|
22
|
+
if (commandId === undefined) {
|
|
23
|
+
console.error('❌ attach command not found', config);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.log('🟡 dispatchViewManagerCommand tag:', tag);
|
|
27
|
+
console.log('🟡 dispatchViewManagerCommand commandId:', commandId);
|
|
28
|
+
_reactNative.UIManager.dispatchViewManagerCommand(tag, commandId, [params.url, params.custId, params.areaCd, params.defaultImage]);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=OnCmsBannerCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","VIEW_NAME","attachBanner","ref","params","console","log","tag","findNodeHandle","current","config","UIManager","getViewManagerConfig","commandId","Constants","Commands","setOnCmsBannerParam","undefined","error","dispatchViewManagerCommand","url","custId","areaCd","defaultImage"],"sourceRoot":"../../src","sources":["OnCmsBannerCommands.js"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AADA;;AAGA,MAAMC,SAAS,GAAG,iBAAiB;AAE5B,SAASC,YAAYA,CAACC,GAAG,EAAEC,MAAM,EAAE;EACtCC,OAAO,CAACC,GAAG,CAAC,qBAAqB,EAAEH,GAAG,CAAC;EACvCE,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEF,MAAM,CAAC;EAC7C,MAAMG,GAAG,GAAG,IAAAC,2BAAc,EAACL,GAAG,CAACM,OAAO,CAAC;EACvC,IAAI,CAACF,GAAG,EAAE;;EAEV;EACA,MAAMG,MAAM,GAAGC,sBAAS,CAACC,oBAAoB,CAACX,SAAS,CAAC;EAC5D;EACI;EACA,MAAMY,SAAS,GAAGH,MAAM,EAAEI,SAAS,EAAEC,QAAQ,EAAEC,mBAAmB;EAElE,IAAIH,SAAS,KAAKI,SAAS,EAAE;IACzBZ,OAAO,CAACa,KAAK,CAAC,4BAA4B,EAAER,MAAM,CAAC;IACnD;EACJ;EAEAL,OAAO,CAACC,GAAG,CAAC,oCAAoC,EAAEC,GAAG,CAAC;EACtDF,OAAO,CAACC,GAAG,CAAC,0CAA0C,EAAEO,SAAS,CAAC;EAClEF,sBAAS,CAACQ,0BAA0B,CAACZ,GAAG,EAAEM,SAAS,EAAE,CACjDT,MAAM,CAACgB,GAAG,EACVhB,MAAM,CAACiB,MAAM,EACbjB,MAAM,CAACkB,MAAM,EACblB,MAAM,CAACmB,YAAY,CACtB,CAAC;AACN","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -30,6 +30,8 @@ var _TagWorksDeeplink = _interopRequireDefault(require("./TagWorksDeeplink.js"))
|
|
|
30
30
|
var _RegisterOnCmsBannerView = _interopRequireDefault(require("./RegisterOnCmsBannerView.js"));
|
|
31
31
|
var _ReactNavigationPageTracker = require("./autoTrackers/ReactNavigationPageTracker.js");
|
|
32
32
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
|
+
// import { attachBanner } from './OnCmsBannerCommands';
|
|
34
|
+
|
|
33
35
|
// NativeModules
|
|
34
36
|
const {
|
|
35
37
|
TagWorksModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_TagWorksDeeplink","_interopRequireDefault","_RegisterOnCmsBannerView","_ReactNavigationPageTracker","e","__esModule","default","TagWorksModule","DataBundleModule","StandardEventModule","TagWorksPopupModule","TagWorksDeeplinkModule","NativeModules","exports"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAD,sBAAA,CAAAF,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_TagWorksDeeplink","_interopRequireDefault","_RegisterOnCmsBannerView","_ReactNavigationPageTracker","e","__esModule","default","TagWorksModule","DataBundleModule","StandardEventModule","TagWorksPopupModule","TagWorksDeeplinkModule","NativeModules","exports"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,2BAAA,GAAAJ,OAAA;AAAwF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AADxF;;AAGA;AACA,MAAM;EACJG,cAAc;EACdC,gBAAgB;EAChBC,mBAAmB;EACnBC,mBAAmB;EACnBC;AACF,CAAC,GAAGC,0BAAa;;AAgBjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAC,OAAA,CAAAF,sBAAA,GAAAA,sBAAA;AAAAE,OAAA,CAAAH,mBAAA,GAAAA,mBAAA;AAAAG,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AAAAI,OAAA,CAAAL,gBAAA,GAAAA,gBAAA;AAAAK,OAAA,CAAAN,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// OnCmsBannerCommands.js
|
|
4
|
+
import { UIManager, findNodeHandle, Platform } from 'react-native';
|
|
5
|
+
const VIEW_NAME = 'OnCmsBannerView';
|
|
6
|
+
export function attachBanner(ref, params) {
|
|
7
|
+
console.log('🟡 attachBannerRef:', ref);
|
|
8
|
+
console.log('🟡 attachBannerParams:', params);
|
|
9
|
+
const tag = findNodeHandle(ref.current);
|
|
10
|
+
if (!tag) return;
|
|
11
|
+
|
|
12
|
+
// 'VIEW_NAME'에 해당하는 네이티브 ViewManager 정보 조회
|
|
13
|
+
const config = UIManager.getViewManagerConfig(VIEW_NAME);
|
|
14
|
+
// console.log('🟡 ViewManagerConfig:', config);
|
|
15
|
+
// const commandId = config.Commands.setOnCmsBannerParam;
|
|
16
|
+
const commandId = config?.Constants?.Commands?.setOnCmsBannerParam;
|
|
17
|
+
if (commandId === undefined) {
|
|
18
|
+
console.error('❌ attach command not found', config);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
console.log('🟡 dispatchViewManagerCommand tag:', tag);
|
|
22
|
+
console.log('🟡 dispatchViewManagerCommand commandId:', commandId);
|
|
23
|
+
UIManager.dispatchViewManagerCommand(tag, commandId, [params.url, params.custId, params.areaCd, params.defaultImage]);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=OnCmsBannerCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UIManager","findNodeHandle","Platform","VIEW_NAME","attachBanner","ref","params","console","log","tag","current","config","getViewManagerConfig","commandId","Constants","Commands","setOnCmsBannerParam","undefined","error","dispatchViewManagerCommand","url","custId","areaCd","defaultImage"],"sourceRoot":"../../src","sources":["OnCmsBannerCommands.js"],"mappings":";;AAAA;AACA,SAASA,SAAS,EAAEC,cAAc,EAAEC,QAAQ,QAAQ,cAAc;AAElE,MAAMC,SAAS,GAAG,iBAAiB;AAEnC,OAAO,SAASC,YAAYA,CAACC,GAAG,EAAEC,MAAM,EAAE;EACtCC,OAAO,CAACC,GAAG,CAAC,qBAAqB,EAAEH,GAAG,CAAC;EACvCE,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEF,MAAM,CAAC;EAC7C,MAAMG,GAAG,GAAGR,cAAc,CAACI,GAAG,CAACK,OAAO,CAAC;EACvC,IAAI,CAACD,GAAG,EAAE;;EAEV;EACA,MAAME,MAAM,GAAGX,SAAS,CAACY,oBAAoB,CAACT,SAAS,CAAC;EAC5D;EACI;EACA,MAAMU,SAAS,GAAGF,MAAM,EAAEG,SAAS,EAAEC,QAAQ,EAAEC,mBAAmB;EAElE,IAAIH,SAAS,KAAKI,SAAS,EAAE;IACzBV,OAAO,CAACW,KAAK,CAAC,4BAA4B,EAAEP,MAAM,CAAC;IACnD;EACJ;EAEAJ,OAAO,CAACC,GAAG,CAAC,oCAAoC,EAAEC,GAAG,CAAC;EACtDF,OAAO,CAACC,GAAG,CAAC,0CAA0C,EAAEK,SAAS,CAAC;EAClEb,SAAS,CAACmB,0BAA0B,CAACV,GAAG,EAAEI,SAAS,EAAE,CACjDP,MAAM,CAACc,GAAG,EACVd,MAAM,CAACe,MAAM,EACbf,MAAM,CAACgB,MAAM,EACbhB,MAAM,CAACiB,YAAY,CACtB,CAAC;AACN","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { NativeModules } from 'react-native';
|
|
4
4
|
import TagWorksDeeplink from "./TagWorksDeeplink.js";
|
|
5
5
|
import OnCmsBannerView from "./RegisterOnCmsBannerView.js";
|
|
6
|
+
// import { attachBanner } from './OnCmsBannerCommands';
|
|
6
7
|
import { TagWorksNavigationContainer } from "./autoTrackers/ReactNavigationPageTracker.js";
|
|
7
8
|
|
|
8
9
|
// NativeModules
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","TagWorksDeeplink","OnCmsBannerView","TagWorksNavigationContainer","TagWorksModule","DataBundleModule","StandardEventModule","TagWorksPopupModule","TagWorksDeeplinkModule"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,eAAe,MAAM,8BAA2B;AACvD,SAASC,2BAA2B,QAAQ,8CAA2C;;AAEvF;AACA,MAAM;EACJC,cAAc;EACdC,gBAAgB;EAChBC,mBAAmB;EACnBC,mBAAmB;EACnBC;AACF,CAAC,GAAGR,aAAa;AAEjB,SACEI,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,mBAAmB,EACnBC,sBAAsB,EACtBP,gBAAgB,EAChBC,eAAe,EACfC,2BAA2B;;AAM7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NativeModules","TagWorksDeeplink","OnCmsBannerView","TagWorksNavigationContainer","TagWorksModule","DataBundleModule","StandardEventModule","TagWorksPopupModule","TagWorksDeeplinkModule"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,eAAe,MAAM,8BAA2B;AACvD;AACA,SAASC,2BAA2B,QAAQ,8CAA2C;;AAEvF;AACA,MAAM;EACJC,cAAc;EACdC,gBAAgB;EAChBC,mBAAmB;EACnBC,mBAAmB;EACnBC;AACF,CAAC,GAAGR,aAAa;AAEjB,SACEI,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,mBAAmB,EACnBC,sBAAsB,EACtBP,gBAAgB,EAChBC,eAAe,EACfC,2BAA2B;;AAM7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare function getCanvasRawFingerprint(): {
|
|
2
|
+
winding: boolean;
|
|
3
|
+
geometry: any;
|
|
4
|
+
text: any;
|
|
5
|
+
};
|
|
6
|
+
declare function getUnstableCanvasFingerprint(skipImages: any): {
|
|
7
|
+
winding: boolean;
|
|
8
|
+
geometry: any;
|
|
9
|
+
text: any;
|
|
10
|
+
};
|
|
11
|
+
declare function makeCanvasContext(): any[];
|
|
12
|
+
declare function isSupported(canvas: any, context: any): boolean;
|
|
13
|
+
declare function doesSupportWinding(context: any): boolean;
|
|
14
|
+
declare function renderImages(canvas: any, context: any): any[];
|
|
15
|
+
declare function renderTextImage(canvas: any, context: any): void;
|
|
16
|
+
declare function renderGeometryImage(canvas: any, context: any): void;
|
|
17
|
+
declare function canvasToString(canvas: any): any;
|
|
18
|
+
declare function doesBrowserPerformAntifingerprinting(): boolean;
|
|
19
|
+
//# sourceMappingURL=fingerprint_lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint_lib.d.ts","sourceRoot":"","sources":["../../../../../../../../../android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.js"],"names":[],"mappings":"AAGA;;;;EAEC;AAID;;;;EA6BC;AAGD,4CAKC;AAGD,iEAEC;AAID,2DASC;AAGD,gEAkBC;AAGD,kEAoBC;AAGD,sEA6BC;AAGD,kDAEC;AAKD,iEAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnCmsBannerCommands.d.ts","sourceRoot":"","sources":["../../../../src/OnCmsBannerCommands.js"],"names":[],"mappings":"AAKA,0DAyBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.js"],"names":[],"mappings":";;;;;6BAC6B,oBAAoB;4BACrB,2BAA2B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.js"],"names":[],"mappings":";;;;;6BAC6B,oBAAoB;4BACrB,2BAA2B;4CAEX,2CAA2C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare function getCanvasRawFingerprint(): {
|
|
2
|
+
winding: boolean;
|
|
3
|
+
geometry: any;
|
|
4
|
+
text: any;
|
|
5
|
+
};
|
|
6
|
+
declare function getUnstableCanvasFingerprint(skipImages: any): {
|
|
7
|
+
winding: boolean;
|
|
8
|
+
geometry: any;
|
|
9
|
+
text: any;
|
|
10
|
+
};
|
|
11
|
+
declare function makeCanvasContext(): any[];
|
|
12
|
+
declare function isSupported(canvas: any, context: any): boolean;
|
|
13
|
+
declare function doesSupportWinding(context: any): boolean;
|
|
14
|
+
declare function renderImages(canvas: any, context: any): any[];
|
|
15
|
+
declare function renderTextImage(canvas: any, context: any): void;
|
|
16
|
+
declare function renderGeometryImage(canvas: any, context: any): void;
|
|
17
|
+
declare function canvasToString(canvas: any): any;
|
|
18
|
+
declare function doesBrowserPerformAntifingerprinting(): boolean;
|
|
19
|
+
//# sourceMappingURL=fingerprint_lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint_lib.d.ts","sourceRoot":"","sources":["../../../../../../../../../android/build/intermediates/assets/debugAndroidTest/mergeDebugAndroidTestAssets/fingerprint_lib.js"],"names":[],"mappings":"AAGA;;;;EAEC;AAID;;;;EA6BC;AAGD,4CAKC;AAGD,iEAEC;AAID,2DASC;AAGD,gEAkBC;AAGD,kEAoBC;AAGD,sEA6BC;AAGD,kDAEC;AAKD,iEAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnCmsBannerCommands.d.ts","sourceRoot":"","sources":["../../../../src/OnCmsBannerCommands.js"],"names":[],"mappings":"AAKA,0DAyBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.js"],"names":[],"mappings":";;;;;6BAC6B,oBAAoB;4BACrB,2BAA2B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.js"],"names":[],"mappings":";;;;;6BAC6B,oBAAoB;4BACrB,2BAA2B;4CAEX,2CAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tagworks-sdk-v1-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"description": "TagWorks SDK React Native Library",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -89,27 +89,25 @@
|
|
|
89
89
|
"@types/react": "^18.2.44"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"react": "*",
|
|
93
|
-
"react-native": "*",
|
|
94
|
-
|
|
95
|
-
|
|
96
92
|
"@react-navigation/native": "*",
|
|
97
93
|
"@react-navigation/native-stack": "*",
|
|
98
|
-
"react
|
|
99
|
-
"react-native
|
|
94
|
+
"react": "*",
|
|
95
|
+
"react-native": "*",
|
|
96
|
+
"react-native-safe-area-context": "*",
|
|
97
|
+
"react-native-screens": "*"
|
|
100
98
|
},
|
|
101
99
|
"peerDependenciesMeta": {
|
|
102
|
-
"@react-navigation/native": {
|
|
103
|
-
"optional": true
|
|
100
|
+
"@react-navigation/native": {
|
|
101
|
+
"optional": true
|
|
104
102
|
},
|
|
105
|
-
"@react-navigation/native-stack": {
|
|
106
|
-
"optional": true
|
|
103
|
+
"@react-navigation/native-stack": {
|
|
104
|
+
"optional": true
|
|
107
105
|
},
|
|
108
|
-
"react-native-
|
|
109
|
-
"optional": true
|
|
106
|
+
"react-native-safe-area-context": {
|
|
107
|
+
"optional": true
|
|
110
108
|
},
|
|
111
|
-
"react-native-
|
|
112
|
-
"optional": true
|
|
109
|
+
"react-native-screens": {
|
|
110
|
+
"optional": true
|
|
113
111
|
}
|
|
114
112
|
},
|
|
115
113
|
"workspaces": [
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// OnCmsBannerCommands.js
|
|
2
|
+
import { UIManager, findNodeHandle, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const VIEW_NAME = 'OnCmsBannerView';
|
|
5
|
+
|
|
6
|
+
export function attachBanner(ref, params) {
|
|
7
|
+
console.log('🟡 attachBannerRef:', ref);
|
|
8
|
+
console.log('🟡 attachBannerParams:', params);
|
|
9
|
+
const tag = findNodeHandle(ref.current);
|
|
10
|
+
if (!tag) return;
|
|
11
|
+
|
|
12
|
+
// 'VIEW_NAME'에 해당하는 네이티브 ViewManager 정보 조회
|
|
13
|
+
const config = UIManager.getViewManagerConfig(VIEW_NAME);
|
|
14
|
+
// console.log('🟡 ViewManagerConfig:', config);
|
|
15
|
+
// const commandId = config.Commands.setOnCmsBannerParam;
|
|
16
|
+
const commandId = config?.Constants?.Commands?.setOnCmsBannerParam;
|
|
17
|
+
|
|
18
|
+
if (commandId === undefined) {
|
|
19
|
+
console.error('❌ attach command not found', config);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log('🟡 dispatchViewManagerCommand tag:', tag);
|
|
24
|
+
console.log('🟡 dispatchViewManagerCommand commandId:', commandId);
|
|
25
|
+
UIManager.dispatchViewManagerCommand(tag, commandId, [
|
|
26
|
+
params.url,
|
|
27
|
+
params.custId,
|
|
28
|
+
params.areaCd,
|
|
29
|
+
params.defaultImage,
|
|
30
|
+
]);
|
|
31
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
import TagWorksDeeplink from './TagWorksDeeplink';
|
|
3
3
|
import OnCmsBannerView from './RegisterOnCmsBannerView';
|
|
4
|
+
// import { attachBanner } from './OnCmsBannerCommands';
|
|
4
5
|
import { TagWorksNavigationContainer } from './autoTrackers/ReactNavigationPageTracker';
|
|
5
6
|
|
|
6
7
|
// NativeModules
|
|
@@ -9,7 +10,7 @@ const {
|
|
|
9
10
|
DataBundleModule,
|
|
10
11
|
StandardEventModule,
|
|
11
12
|
TagWorksPopupModule,
|
|
12
|
-
TagWorksDeeplinkModule
|
|
13
|
+
TagWorksDeeplinkModule,
|
|
13
14
|
} = NativeModules;
|
|
14
15
|
|
|
15
16
|
export {
|