@screeb/react-native 2.1.17 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +24 -5
  2. package/{screeb-module.podspec → ScreebReactNative.podspec} +6 -4
  3. package/android/build.gradle +36 -86
  4. package/android/gradle.properties +5 -3
  5. package/android/src/main/AndroidManifest.xml +1 -3
  6. package/android/src/main/java/app/screeb/reactnative/ScreebReactNativeModule.kt +258 -0
  7. package/android/src/main/java/app/screeb/reactnative/ScreebReactNativePackage.kt +33 -0
  8. package/ios/ScreebReactNative.m +63 -0
  9. package/ios/{ScreebModule.swift → ScreebReactNative.swift} +116 -32
  10. package/lib/module/NativeScreebReactNative.js +10 -0
  11. package/lib/module/NativeScreebReactNative.js.map +1 -0
  12. package/lib/module/index.js +170 -88
  13. package/lib/module/index.js.map +1 -0
  14. package/lib/module/package.json +1 -0
  15. package/lib/typescript/package.json +1 -0
  16. package/lib/typescript/src/NativeScreebReactNative.d.ts +49 -0
  17. package/lib/typescript/src/NativeScreebReactNative.d.ts.map +1 -0
  18. package/lib/typescript/src/index.d.ts +25 -0
  19. package/lib/typescript/src/index.d.ts.map +1 -0
  20. package/package.json +153 -59
  21. package/src/NativeScreebReactNative.ts +81 -0
  22. package/src/index.tsx +251 -144
  23. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  24. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  25. package/android/gradlew +0 -185
  26. package/android/gradlew.bat +0 -89
  27. package/android/src/main/java/com/screebmodule/ScreebModuleModule.kt +0 -186
  28. package/android/src/main/java/com/screebmodule/ScreebModulePackage.kt +0 -17
  29. package/ios/ScreebModule-Bridging-Header.h +0 -3
  30. package/ios/ScreebModule.m +0 -24
  31. package/ios/ScreebModule.xcodeproj/project.pbxproj +0 -293
  32. package/lib/commonjs/index.js +0 -130
  33. package/lib/typescript/index.d.ts +0 -13
@@ -1,9 +1,22 @@
1
1
  import Screeb
2
+ import React
2
3
  import UIKit
3
4
  import Foundation
4
5
 
5
- @objc(ScreebModule)
6
- class ScreebModule: RCTEventEmitter {
6
+ @objc(ScreebReactNative)
7
+ class ScreebReactNative: RCTEventEmitter {
8
+ private var hasListeners = false
9
+ private var pendingEvents: [[String: Any]] = []
10
+
11
+ override func startObserving() {
12
+ hasListeners = true
13
+ flushPendingEventsIfPossible()
14
+ }
15
+
16
+ override func stopObserving() {
17
+ hasListeners = false
18
+ }
19
+
7
20
  @objc(initSdk:userId:properties:hooks:initOptions:language:)
8
21
  func initSdk(
9
22
  _ channelId: String,
@@ -13,26 +26,19 @@ class ScreebModule: RCTEventEmitter {
13
26
  initOptions initOptions_: [String: Any]?,
14
27
  language language_: String?
15
28
  ) {
16
- Screeb.setSecondarySDK(name: "react-native", version: "2.1.17")
17
- var map: [String: AnyEncodable?] = [:]
18
- if (properties_ != nil) {
19
- map = self.mapToAnyEncodable(map: properties_!)
20
- }
21
- var mapHooks: [String: Any?]? = nil
29
+ Screeb.setSecondarySDK(name: "react-native", version: "2.2.0")
30
+ var mapHooks: [String: Any]? = nil
22
31
  if (hooks_ != nil) {
23
32
  mapHooks = [:]
24
33
  hooks_?.forEach{ hook in
25
34
  if (hook.key == "version") {
26
- mapHooks![hook.key] = hook.value as? String
35
+ if let v = hook.value as? String {
36
+ mapHooks![hook.key] = v
37
+ }
27
38
  } else {
28
- mapHooks![hook.key] = {(payload:Any) -> () in DispatchQueue.main.async {
29
- guard let data = try? JSONEncoder().encode(self.toAnyEncodable(payload)) else {
30
- return
31
- }
32
-
33
- let encoded = String(data: data, encoding: .utf8)!
34
- self.sendEvent(withName: "ScreebEvent", body: ["hookId": hook.value, "payload": encoded])
35
- }}
39
+ mapHooks![hook.key] = { [weak self] (payload: Any) -> () in
40
+ self?.emitHookEvent(hookId: hook.value, payload: payload)
41
+ }
36
42
  }
37
43
  }
38
44
  }
@@ -45,7 +51,7 @@ class ScreebModule: RCTEventEmitter {
45
51
  }
46
52
 
47
53
  DispatchQueue.main.async {
48
- Screeb.initSdk(context: nil, channelId: channelId, identity: userId_, visitorProperty: map, initOptions: initOptions, hooks: mapHooks, language: language_)
54
+ Screeb.initSdk(context: nil, channelId: channelId, identity: userId_, visitorProperty: self.mapToAnyEncodable(map: properties_), initOptions: initOptions, hooks: mapHooks, language: language_)
49
55
  }
50
56
  }
51
57
 
@@ -80,38 +86,60 @@ class ScreebModule: RCTEventEmitter {
80
86
  }
81
87
 
82
88
  @objc(setProperties:)
83
- func setVisitorPropertiesImpl(_ properties: [String: Any]) {
89
+ func setVisitorPropertiesImpl(_ properties: [String: Any]?) {
84
90
  let map = self.mapToAnyEncodable(map: properties)
85
91
  DispatchQueue.main.async {
86
92
  Screeb.visitorProperty(visitorProperty: map)
87
93
  }
88
94
  }
89
95
 
90
- @objc func startSurvey(_ surveyId: String, allowMultipleResponses allowMultipleResponses_: Bool, hiddenFields hiddenFields_: [String: Any]?,ignoreSurveyStatus ignoreSurveyStatus_: Bool, hooks hooks_: [String: Any]?, language language_: String?) {
96
+ @objc func startSurvey(_ surveyId: String, allowMultipleResponses allowMultipleResponses_: Bool, hiddenFields hiddenFields_: [String: Any]?,ignoreSurveyStatus ignoreSurveyStatus_: Bool, hooks hooks_: [String: Any]?, language language_: String?, distributionId distributionId_: String?) {
91
97
  var map: [String: AnyEncodable] = [:]
92
98
  if (hiddenFields_ != nil) {
93
99
  map = self.mapToAnyEncodable(map: hiddenFields_!).filter({ $0.value != nil }).mapValues({ $0! })
94
100
  }
95
- var mapHooks: [String: Any?]? = nil
101
+ var mapHooks: [String: Any]? = nil
96
102
  if (hooks_ != nil) {
97
103
  mapHooks = [:]
98
104
  hooks_?.forEach{ hook in
99
105
  if(hook.key == "version"){
100
- mapHooks![hook.key] = hook.value as? String
101
- } else {
102
- mapHooks![hook.key] = {(payload:Any) -> () in DispatchQueue.main.async {
103
- guard let data = try? JSONEncoder().encode(self.toAnyEncodable(payload)) else {
104
- return
106
+ if let v = hook.value as? String {
107
+ mapHooks![hook.key] = v
105
108
  }
109
+ } else {
110
+ mapHooks![hook.key] = { [weak self] (payload: Any) -> () in
111
+ self?.emitHookEvent(hookId: hook.value, payload: payload)
112
+ }
113
+ }
114
+ }
115
+ }
116
+ DispatchQueue.main.async {
117
+ Screeb.startSurvey(surveyId: surveyId, allowMultipleResponses: allowMultipleResponses_, hiddenFields: map, ignoreSurveyStatus: ignoreSurveyStatus_, hooks: mapHooks, language: language_, distributionId: distributionId_)
118
+ }
119
+ }
106
120
 
107
- let encoded = String(data: data, encoding: .utf8)!
108
- self.sendEvent(withName: "ScreebEvent", body: ["hookId": hook.value, "payload": encoded])
109
- }}
121
+ @objc func startMessage(_ messageId: String, allowMultipleResponses allowMultipleResponses_: Bool, hiddenFields hiddenFields_: [String: Any]?, ignoreMessageStatus ignoreMessageStatus_: Bool, hooks hooks_: [String: Any]?, language language_: String?, distributionId distributionId_: String?) {
122
+ var map: [String: AnyEncodable] = [:]
123
+ if (hiddenFields_ != nil) {
124
+ map = self.mapToAnyEncodable(map: hiddenFields_!).filter({ $0.value != nil }).mapValues({ $0! })
125
+ }
126
+ var mapHooks: [String: Any]? = nil
127
+ if (hooks_ != nil) {
128
+ mapHooks = [:]
129
+ hooks_?.forEach{ hook in
130
+ if(hook.key == "version"){
131
+ if let v = hook.value as? String {
132
+ mapHooks![hook.key] = v
133
+ }
134
+ } else {
135
+ mapHooks![hook.key] = { [weak self] (payload: Any) -> () in
136
+ self?.emitHookEvent(hookId: hook.value, payload: payload)
137
+ }
110
138
  }
111
139
  }
112
140
  }
113
141
  DispatchQueue.main.async {
114
- Screeb.startSurvey(surveyId: surveyId, allowMultipleResponses: allowMultipleResponses_, hiddenFields: map, ignoreSurveyStatus: ignoreSurveyStatus_, hooks: mapHooks, language: language_)
142
+ Screeb.startMessage(messageId: messageId, allowMultipleResponses: allowMultipleResponses_, hiddenFields: map, ignoreMessageStatus: ignoreMessageStatus_, hooks: mapHooks, language: language_, distributionId: distributionId_)
115
143
  }
116
144
  }
117
145
 
@@ -147,9 +175,15 @@ class ScreebModule: RCTEventEmitter {
147
175
  }
148
176
  }
149
177
 
150
- @objc func closeSurvey(){
178
+ @objc func closeSurvey(_ surveyId: String?){
151
179
  DispatchQueue.main.async {
152
- Screeb.closeSurvey()
180
+ Screeb.closeSurvey(surveyId: surveyId)
181
+ }
182
+ }
183
+
184
+ @objc func closeMessage(_ messageId: String?){
185
+ DispatchQueue.main.async {
186
+ Screeb.closeMessage(messageId: messageId)
153
187
  }
154
188
  }
155
189
 
@@ -204,6 +238,56 @@ class ScreebModule: RCTEventEmitter {
204
238
  return anyEncodableMap
205
239
  }
206
240
 
241
+ private func emitHookEvent(hookId: Any?, payload: Any) {
242
+ guard let hookKey = hookId as? String else {
243
+ return
244
+ }
245
+
246
+ guard let data = try? JSONEncoder().encode(toAnyEncodable(payload)),
247
+ let encoded = String(data: data, encoding: .utf8) else {
248
+ return
249
+ }
250
+
251
+ let body: [String: Any] = ["hookId": hookKey, "payload": encoded]
252
+
253
+ let sendBlock = { [weak self] in
254
+ guard let self else { return }
255
+ if self.hasListeners, self.callableJSModules != nil {
256
+ self.sendEvent(withName: "ScreebEvent", body: body)
257
+ } else {
258
+ self.pendingEvents.append(body)
259
+ }
260
+ }
261
+
262
+ if Thread.isMainThread {
263
+ sendBlock()
264
+ flushPendingEventsIfPossible()
265
+ } else {
266
+ DispatchQueue.main.async {
267
+ sendBlock()
268
+ self.flushPendingEventsIfPossible()
269
+ }
270
+ }
271
+ }
272
+
273
+ private func flushPendingEventsIfPossible() {
274
+ guard hasListeners, callableJSModules != nil, !pendingEvents.isEmpty else { return }
275
+
276
+ let events = pendingEvents
277
+ pendingEvents.removeAll()
278
+
279
+ let flushBlock = { [weak self] in
280
+ guard let self else { return }
281
+ events.forEach { self.sendEvent(withName: "ScreebEvent", body: $0) }
282
+ }
283
+
284
+ if Thread.isMainThread {
285
+ flushBlock()
286
+ } else {
287
+ DispatchQueue.main.async(execute: flushBlock)
288
+ }
289
+ }
290
+
207
291
  override func supportedEvents() -> [String]! {
208
292
  return ["ScreebEvent"]
209
293
  }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from "react-native";
4
+ const module = TurboModuleRegistry.get("ScreebReactNative");
5
+ if (!module) {
6
+ const LINKING_ERROR = `The native module "ScreebReactNative" could not be found.\n` + "- Ensure the iOS/Android native code is compiled (iOS: run 'pod install' in the example app, then rebuild).\n" + "- If you're developing locally, run 'yarn prepare' to rebuild the JS output.\n" + "- On iOS, make sure the podspec is included and the app is rebuilt (not just reloaded).";
7
+ throw new Error(LINKING_ERROR);
8
+ }
9
+ export default module;
10
+ //# sourceMappingURL=NativeScreebReactNative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","module","get","LINKING_ERROR","Error"],"sourceRoot":"../../src","sources":["NativeScreebReactNative.ts"],"mappings":";;AAAA,SAA2BA,mBAAmB,QAAQ,cAAc;AAsEpE,MAAMC,MAAM,GAAGD,mBAAmB,CAACE,GAAG,CAAO,mBAAmB,CAAC;AACjE,IAAI,CAACD,MAAM,EAAE;EACZ,MAAME,aAAa,GAClB,6DAA6D,GAC7D,+GAA+G,GAC/G,gFAAgF,GAChF,yFAAyF;EAC1F,MAAM,IAAIC,KAAK,CAACD,aAAa,CAAC;AAC/B;AAEA,eAAeF,MAAM","ignoreList":[]}
@@ -1,115 +1,197 @@
1
- import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform, } from "react-native";
2
- const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` +
3
- Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) +
4
- "- You rebuilt the app after installing the package\n" +
5
- "- You are not using Expo managed workflow\n";
6
- const ScreebModule = NativeModules.ScreebModule
7
- ? NativeModules.ScreebModule
8
- : new Proxy({}, {
9
- get() {
10
- throw new Error(LINKING_ERROR);
11
- },
1
+ "use strict";
2
+
3
+ import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from "react-native";
4
+ import ScreebReactNative from "./NativeScreebReactNative.js";
5
+
6
+ // biome-ignore lint/suspicious/noExplicitAny: .
7
+ let emitter;
8
+ // initSdk
9
+ export function initSdk(channelId, userId, properties, hooks, initOptions, language) {
10
+ // Use NativeEventEmitter on both platforms; pass the native module on iOS
11
+ // and rely on the default emitter on Android.
12
+ if (Platform.OS === "ios") {
13
+ emitter = new NativeEventEmitter(NativeModules.ScreebReactNative);
14
+ } else {
15
+ emitter = DeviceEventEmitter;
16
+ }
17
+ emitter.addListener("ScreebEvent", handleEvent);
18
+ let mapHooksId;
19
+ if (hooks != null) {
20
+ mapHooksId = {};
21
+ Object.keys(hooks).map(key => {
22
+ if (key === "version") {
23
+ const v = hooks.version ?? undefined;
24
+ if (v) mapHooksId = {
25
+ ...mapHooksId,
26
+ version: v
27
+ };
28
+ } else {
29
+ const uuid = Date.now().toString() + Math.random().toString() + key;
30
+ const fn = hooks[key];
31
+ if (typeof fn === "function") {
32
+ hooksRegistry.set(uuid, fn);
33
+ }
34
+ mapHooksId = {
35
+ ...mapHooksId,
36
+ [key]: uuid
37
+ };
38
+ }
12
39
  });
13
- let hooksRegistry = new Map();
14
- export function initSdk(androidChannelId, iosChannelId, userId, properties, hooks, isDebugMode, language) {
15
- const emitter = Platform.OS === "ios"
16
- ? new NativeEventEmitter(NativeModules.ScreebModule)
17
- : DeviceEventEmitter;
18
- emitter.addListener("ScreebEvent", handleEvent);
19
- let mapHooksId = undefined;
20
- if (hooks != null) {
21
- mapHooksId = new Object();
22
- Object.keys(hooks).map((key) => {
23
- if (key == "version") {
24
- mapHooksId = { ...mapHooksId, version: hooks[key] };
25
- }
26
- else {
27
- let uuid = Date.now().toString() + Math.random().toString() + key;
28
- hooksRegistry.set(uuid, hooks[key]);
29
- mapHooksId = { ...mapHooksId, [key]: uuid };
30
- }
31
- });
32
- }
33
- if (Platform.OS === "ios") {
34
- return ScreebModule.initSdk(iosChannelId, userId, properties, mapHooksId, isDebugMode, language);
35
- }
36
- else {
37
- return ScreebModule.initSdk(androidChannelId, userId, properties, mapHooksId, isDebugMode, language);
38
- }
40
+ }
41
+ return ScreebReactNative.initSdk(channelId, userId, toObject(properties), mapHooksId, initOptions, language);
39
42
  }
43
+
44
+ // setIdentity
40
45
  export function setIdentity(userId, properties) {
41
- return ScreebModule.setIdentity(userId, properties);
46
+ return ScreebReactNative.setIdentity(userId, toObject(properties));
42
47
  }
48
+
49
+ // setProperties
43
50
  export function setProperties(properties) {
44
- return ScreebModule.setProperties(properties);
51
+ return ScreebReactNative.setProperties(toObject(properties));
45
52
  }
53
+
54
+ // assignGroup
46
55
  export function assignGroup(type, name, properties) {
47
- return ScreebModule.assignGroup(type, name, properties);
56
+ return ScreebReactNative.assignGroup(type, name, toObject(properties));
48
57
  }
58
+
59
+ // unassignGroup
49
60
  export function unassignGroup(type, name, properties) {
50
- return ScreebModule.unassignGroup(type, name, properties);
61
+ return ScreebReactNative.unassignGroup(type, name, toObject(properties));
51
62
  }
63
+
64
+ // trackEvent
52
65
  export function trackEvent(name, properties) {
53
- return ScreebModule.trackEvent(name, properties);
66
+ return ScreebReactNative.trackEvent(name, toObject(properties));
54
67
  }
68
+
69
+ // trackScreen
55
70
  export function trackScreen(name, properties) {
56
- return ScreebModule.trackScreen(name, properties);
57
- }
58
- export function startSurvey(surveyId, allowMultipleResponses, hiddenFields, ignoreSurveyStatus, hooks, language) {
59
- let mapHooksId = undefined;
60
- if (hooks != undefined) {
61
- mapHooksId = new Object();
62
- Object.keys(hooks).map((key) => {
63
- if (key == "version") {
64
- mapHooksId = { ...mapHooksId, version: hooks[key] };
65
- }
66
- else {
67
- let uuid = Date.now().toString() + Math.random().toString() + key;
68
- hooksRegistry.set(uuid, hooks[key]);
69
- mapHooksId = { ...mapHooksId, [key]: uuid };
70
- }
71
- });
72
- }
73
- return ScreebModule.startSurvey(surveyId, allowMultipleResponses ?? true, hiddenFields, ignoreSurveyStatus ?? true, mapHooksId, language);
71
+ return ScreebReactNative.trackScreen(name, toObject(properties));
74
72
  }
73
+
74
+ // startSurvey
75
+ export function startSurvey(surveyId, allowMultipleResponses, hiddenFields, ignoreSurveyStatus, hooks, language, distributionId) {
76
+ let mapHooksId;
77
+ if (hooks !== undefined) {
78
+ mapHooksId = {};
79
+ Object.keys(hooks).map(key => {
80
+ if (key === "version") {
81
+ const v = hooks.version ?? undefined;
82
+ if (v) mapHooksId = {
83
+ ...mapHooksId,
84
+ version: v
85
+ };
86
+ } else {
87
+ const uuid = Date.now().toString() + Math.random().toString() + key;
88
+ const fn = hooks[key];
89
+ if (typeof fn === "function") {
90
+ hooksRegistry.set(uuid, fn);
91
+ }
92
+ mapHooksId = {
93
+ ...mapHooksId,
94
+ [key]: uuid
95
+ };
96
+ }
97
+ });
98
+ }
99
+ return ScreebReactNative.startSurvey(surveyId, allowMultipleResponses ?? true, toObject(hiddenFields), ignoreSurveyStatus ?? true, mapHooksId, language, distributionId);
100
+ }
101
+
102
+ // startMessage
103
+ export function startMessage(messageId, allowMultipleResponses, hiddenFields, ignoreMessageStatus, hooks, language, distributionId) {
104
+ let mapHooksId;
105
+ if (hooks !== undefined) {
106
+ mapHooksId = {};
107
+ Object.keys(hooks).map(key => {
108
+ if (key === "version") {
109
+ const v = hooks.version ?? undefined;
110
+ if (v) mapHooksId = {
111
+ ...mapHooksId,
112
+ version: v
113
+ };
114
+ } else {
115
+ const uuid = Date.now().toString() + Math.random().toString() + key;
116
+ const fn = hooks[key];
117
+ if (typeof fn === "function") {
118
+ hooksRegistry.set(uuid, fn);
119
+ }
120
+ mapHooksId = {
121
+ ...mapHooksId,
122
+ [key]: uuid
123
+ };
124
+ }
125
+ });
126
+ }
127
+ return ScreebReactNative.startMessage(messageId, allowMultipleResponses ?? true, toObject(hiddenFields), ignoreMessageStatus ?? true, mapHooksId, language, distributionId);
128
+ }
129
+
130
+ // debug
75
131
  export function debug() {
76
- return ScreebModule.debug();
132
+ return ScreebReactNative.debug();
77
133
  }
134
+
135
+ // debugTargeting
78
136
  export function debugTargeting() {
79
- return ScreebModule.debugTargeting();
137
+ return ScreebReactNative.debugTargeting();
80
138
  }
139
+
140
+ // resetIdentity
81
141
  export function resetIdentity() {
82
- return ScreebModule.resetIdentity();
142
+ return ScreebReactNative.resetIdentity();
83
143
  }
144
+
145
+ // closeSdk
84
146
  export function closeSdk() {
85
- return ScreebModule.closeSdk();
147
+ if (emitter) {
148
+ emitter.removeAllListeners("ScreebEvent");
149
+ emitter = undefined;
150
+ }
151
+ return ScreebReactNative.closeSdk();
152
+ }
153
+
154
+ // closeSurvey
155
+ export function closeSurvey(surveyId) {
156
+ return ScreebReactNative.closeSurvey(surveyId);
86
157
  }
87
- export function closeSurvey() {
88
- return ScreebModule.closeSurvey();
158
+
159
+ // closeMessage
160
+ export function closeMessage(messageId) {
161
+ return ScreebReactNative.closeMessage(messageId);
89
162
  }
163
+ const hooksRegistry = new Map();
90
164
  function handleEvent(event) {
91
- if (event?.hookId != null) {
92
- let hook = hooksRegistry.get(event.hookId);
93
- if (hook != null) {
94
- const result = hook(event.payload);
95
- const parsedPayload = JSON.parse(event.payload);
96
- const originalHookId = parsedPayload?.hook_id;
97
- if (originalHookId) {
98
- // result must be a map to fit with react native allowed types
99
- // Check if hook is a promise/async function
100
- if (result instanceof Promise) {
101
- result
102
- .then((result) => {
103
- ScreebModule.onHookResult(originalHookId, { result });
104
- })
105
- .catch((error) => {
106
- console.error(error);
107
- });
108
- }
109
- else {
110
- ScreebModule.onHookResult(originalHookId, { result });
111
- }
112
- }
165
+ if (event?.hookId != null) {
166
+ const hook = hooksRegistry.get(event.hookId);
167
+ if (hook != null) {
168
+ const payload = event.payload ?? "{}";
169
+ const result = hook(payload);
170
+ const parsedPayload = JSON.parse(payload);
171
+ const originalHookId = parsedPayload?.hook_id;
172
+ if (originalHookId) {
173
+ if (result instanceof Promise) {
174
+ result.then(result => {
175
+ ScreebReactNative.onHookResult(originalHookId, {
176
+ result
177
+ });
178
+ }).catch(error => {
179
+ console.error(error);
180
+ });
181
+ } else {
182
+ ScreebReactNative.onHookResult(originalHookId, {
183
+ result
184
+ });
113
185
  }
186
+ }
114
187
  }
188
+ }
189
+ }
190
+ function toObject(value) {
191
+ if (value == null) return undefined;
192
+ if (value instanceof Map) {
193
+ return Object.fromEntries(value);
194
+ }
195
+ return value;
115
196
  }
197
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DeviceEventEmitter","NativeEventEmitter","NativeModules","Platform","ScreebReactNative","emitter","initSdk","channelId","userId","properties","hooks","initOptions","language","OS","addListener","handleEvent","mapHooksId","Object","keys","map","key","v","version","undefined","uuid","Date","now","toString","Math","random","fn","hooksRegistry","set","toObject","setIdentity","setProperties","assignGroup","type","name","unassignGroup","trackEvent","trackScreen","startSurvey","surveyId","allowMultipleResponses","hiddenFields","ignoreSurveyStatus","distributionId","startMessage","messageId","ignoreMessageStatus","debug","debugTargeting","resetIdentity","closeSdk","removeAllListeners","closeSurvey","closeMessage","Map","event","hookId","hook","get","payload","result","parsedPayload","JSON","parse","originalHookId","hook_id","Promise","then","onHookResult","catch","error","console","value","fromEntries"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACCA,kBAAkB,EAClBC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QACF,cAAc;AACrB,OAAOC,iBAAiB,MAAM,8BAA2B;;AAEzD;AACA,IAAIC,OAAY;AAchB;AACA,OAAO,SAASC,OAAOA,CACtBC,SAAiB,EACjBC,MAAe,EACfC,UAA2D,EAC3DC,KAAe,EACfC,WAAyB,EACzBC,QAAiB,EAChB;EACD;EACA;EACA,IAAIT,QAAQ,CAACU,EAAE,KAAK,KAAK,EAAE;IAC1BR,OAAO,GAAG,IAAIJ,kBAAkB,CAACC,aAAa,CAACE,iBAAiB,CAAC;EAClE,CAAC,MAAM;IACNC,OAAO,GAAGL,kBAAkB;EAC7B;EAEAK,OAAO,CAACS,WAAW,CAAC,aAAa,EAAEC,WAAW,CAAC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AAG,CAG3B,CAAC;AAEH,SAAS3C,WAAWA,CAAC4C,KAA4C,EAAE;EAClE,IAAIA,KAAK,EAAEC,MAAM,IAAI,IAAI,EAAE;IAC1B,MAAMC,IAAI,GAAG9B,aAAa,CAAC+B,GAAG,CAACH,KAAK,CAACC,MAAM,CAAC;IAC5C,IAAIC,IAAI,IAAI,IAAI,EAAE;MACjB,MAAME,OAAO,GAAGJ,KAAK,CAACI,OAAO,IAAI,IAAI;MACrC,MAAMC,MAAM,GAAGH,IAAI,CAACE,OAAO,CAAC;MAC5B,MAAME,aAAa,GAAGC,IAAI,CAACC,KAAK,CAACJ,OAAO,CAAC;MACzC,MAAMK,cAAc,GAAGH,aAAa,EAAEI,OAAO;MAC7C,IAAID,cAAc,EAAE;QACnB,IAAIJ,MAAM,YAAYM,OAAO,EAAE;UAC9BN,MAAM,CACJO,IAAI,CAAEP,MAAM,IAAK;YACjB5D,iBAAiB,CAACoE,YAAY,CAACJ,cAAc,EAAE;cAAEJ;YAAO,CAAC,CAAC;UAC3D,CAAC,CAAC,CACDS,KAAK,CAAEC,KAAK,IAAK;YACjBC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;UACrB,CAAC,CAAC;QACJ,CAAC,MAAM;UACNtE,iBAAiB,CAACoE,YAAY,CAACJ,cAAc,EAAE;YAAEJ;UAAO,CAAC,CAAC;QAC3D;MACD;IACD;EACD;AACD;AAEA,SAAS/B,QAAQA,CAChB2C,KAA6D,EACpB;EACzC,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAOrD,SAAS;EACnC,IAAIqD,KAAK,YAAYlB,GAAG,EAAE;IACzB,OAAOzC,MAAM,CAAC4D,WAAW,CAACD,KAA6B,CAAC;EACzD;EACA,OAAOA,KAAK;AACb","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,49 @@
1
+ import { type TurboModule } from "react-native";
2
+ type HookIdsMap = {
3
+ [key: string]: string;
4
+ };
5
+ type InitOptions = {
6
+ isDebugMode?: boolean;
7
+ disableMirror?: boolean;
8
+ };
9
+ export interface Spec extends TurboModule {
10
+ initSdk(channelId: string, userId?: string, properties?: {
11
+ [key: string]: unknown;
12
+ } | null, hooks?: HookIdsMap, initOptions?: InitOptions, language?: string): Promise<void>;
13
+ setIdentity(userId: string, properties?: {
14
+ [key: string]: unknown;
15
+ } | null): Promise<void>;
16
+ setProperties(properties?: {
17
+ [key: string]: unknown;
18
+ } | null): Promise<void>;
19
+ assignGroup(type: string | null, name: string, properties?: {
20
+ [key: string]: unknown;
21
+ } | null): Promise<void>;
22
+ unassignGroup(type: string | null, name: string, properties?: {
23
+ [key: string]: unknown;
24
+ } | null): Promise<void>;
25
+ trackEvent(name: string, properties?: {
26
+ [key: string]: unknown;
27
+ } | null): Promise<void>;
28
+ trackScreen(name: string, properties?: {
29
+ [key: string]: unknown;
30
+ } | null): Promise<void>;
31
+ startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: {
32
+ [key: string]: unknown;
33
+ } | null, ignoreSurveyStatus?: boolean, hooks?: HookIdsMap, language?: string, distributionId?: string): Promise<void>;
34
+ startMessage(messageId: string, allowMultipleResponses?: boolean, hiddenFields?: {
35
+ [key: string]: unknown;
36
+ } | null, ignoreMessageStatus?: boolean, hooks?: HookIdsMap, language?: string, distributionId?: string): Promise<void>;
37
+ debug(): Promise<void>;
38
+ debugTargeting(): Promise<void>;
39
+ resetIdentity(): Promise<void>;
40
+ closeSdk(): Promise<void>;
41
+ closeSurvey(surveyId?: string): Promise<void>;
42
+ closeMessage(messageId?: string): Promise<void>;
43
+ onHookResult(hookId: string, result: {
44
+ [key: string]: unknown;
45
+ }): Promise<void>;
46
+ }
47
+ declare const _default: Spec;
48
+ export default _default;
49
+ //# sourceMappingURL=NativeScreebReactNative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeScreebReactNative.d.ts","sourceRoot":"","sources":["../../../src/NativeScreebReactN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,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,YAAY,CACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;wBAYwB,IAAI;AAA7B,wBAA8B"}
@@ -0,0 +1,25 @@
1
+ type HookMap = {
2
+ version?: string;
3
+ [key: string]: unknown;
4
+ };
5
+ type InitOptions = {
6
+ isDebugMode?: boolean;
7
+ disableMirror?: boolean;
8
+ };
9
+ export declare function initSdk(channelId: string, userId?: string, properties?: Record<string, unknown> | Map<string, unknown>, hooks?: HookMap, initOptions?: InitOptions, language?: string): Promise<void>;
10
+ export declare function setIdentity(userId: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
11
+ export declare function setProperties(properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
12
+ export declare function assignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
13
+ export declare function unassignGroup(type: string | null, name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
14
+ export declare function trackEvent(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
15
+ export declare function trackScreen(name: string, properties?: Record<string, unknown> | Map<string, unknown> | null): Promise<void>;
16
+ export declare function startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreSurveyStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void>;
17
+ export declare function startMessage(messageId: string, allowMultipleResponses?: boolean, hiddenFields?: Record<string, unknown> | Map<string, unknown> | null, ignoreMessageStatus?: boolean, hooks?: HookMap, language?: string, distributionId?: string): Promise<void>;
18
+ export declare function debug(): Promise<void>;
19
+ export declare function debugTargeting(): Promise<void>;
20
+ export declare function resetIdentity(): Promise<void>;
21
+ export declare function closeSdk(): Promise<void>;
22
+ export declare function closeSurvey(surveyId?: string): Promise<void>;
23
+ export declare function closeMessage(messageId?: string): Promise<void>;
24
+ export {};
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAYA,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB,CAAC;AAGF,KAAK,WAAW,GAAG;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAGF,wBAAgB,OAAO,CACtB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,KAAK,CAAC,EAAE,OAAO,EACf,WAAW,CAAC,EAAE,WAAW,EACzB,QAAQ,CAAC,EAAE,MAAM,iBAyCjB;AAGD,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,iBAGlE;AAGD,wBAAgB,aAAa,CAC5B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,iBAGlE;AAGD,wBAAgB,WAAW,CAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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