@screeb/react-native 2.1.18 → 2.2.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.
- package/README.md +24 -5
- package/{screeb-module.podspec → ScreebReactNative.podspec} +6 -4
- package/android/build.gradle +36 -86
- package/android/gradle.properties +5 -3
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/app/screeb/reactnative/ScreebReactNativeModule.kt +258 -0
- package/android/src/main/java/app/screeb/reactnative/ScreebReactNativePackage.kt +33 -0
- package/ios/ScreebReactNative.m +63 -0
- package/ios/ScreebReactNative.swift +229 -0
- package/lib/module/NativeScreebReactNative.js +10 -0
- package/lib/module/NativeScreebReactNative.js.map +1 -0
- package/lib/module/index.js +170 -88
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeScreebReactNative.d.ts +49 -0
- package/lib/typescript/src/NativeScreebReactNative.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +25 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +153 -59
- package/src/NativeScreebReactNative.ts +81 -0
- package/src/index.tsx +255 -144
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/screebmodule/ScreebModuleModule.kt +0 -186
- package/android/src/main/java/com/screebmodule/ScreebModulePackage.kt +0 -17
- package/ios/ScreebModule-Bridging-Header.h +0 -3
- package/ios/ScreebModule.m +0 -24
- package/ios/ScreebModule.swift +0 -210
- package/ios/ScreebModule.xcodeproj/project.pbxproj +0 -293
- package/lib/commonjs/index.js +0 -130
- package/lib/typescript/index.d.ts +0 -13
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
// !$*UTF8*$!
|
|
2
|
-
{
|
|
3
|
-
archiveVersion = 1;
|
|
4
|
-
classes = {
|
|
5
|
-
};
|
|
6
|
-
objectVersion = 46;
|
|
7
|
-
objects = {
|
|
8
|
-
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
|
|
11
|
-
5E555C0D2413F4C50049A1A2 /* ScreebModule.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* ScreebModule.m */; };
|
|
12
|
-
F4FF95D7245B92E800C19C63 /* ScreebModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* ScreebModule.swift */; };
|
|
13
|
-
|
|
14
|
-
/* End PBXBuildFile section */
|
|
15
|
-
|
|
16
|
-
/* Begin PBXCopyFilesBuildPhase section */
|
|
17
|
-
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
18
|
-
isa = PBXCopyFilesBuildPhase;
|
|
19
|
-
buildActionMask = 2147483647;
|
|
20
|
-
dstPath = "include/$(PRODUCT_NAME)";
|
|
21
|
-
dstSubfolderSpec = 16;
|
|
22
|
-
files = (
|
|
23
|
-
);
|
|
24
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
25
|
-
};
|
|
26
|
-
/* End PBXCopyFilesBuildPhase section */
|
|
27
|
-
|
|
28
|
-
/* Begin PBXFileReference section */
|
|
29
|
-
134814201AA4EA6300B7C361 /* libScreebModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libScreebModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
30
|
-
|
|
31
|
-
B3E7B5891CC2AC0600A0062D /* ScreebModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreebModule.m; sourceTree = "<group>"; };
|
|
32
|
-
F4FF95D5245B92E700C19C63 /* ScreebModule-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ScreebModule-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
33
|
-
F4FF95D6245B92E800C19C63 /* ScreebModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreebModule.swift; sourceTree = "<group>"; };
|
|
34
|
-
|
|
35
|
-
/* End PBXFileReference section */
|
|
36
|
-
|
|
37
|
-
/* Begin PBXFrameworksBuildPhase section */
|
|
38
|
-
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
39
|
-
isa = PBXFrameworksBuildPhase;
|
|
40
|
-
buildActionMask = 2147483647;
|
|
41
|
-
files = (
|
|
42
|
-
);
|
|
43
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
44
|
-
};
|
|
45
|
-
/* End PBXFrameworksBuildPhase section */
|
|
46
|
-
|
|
47
|
-
/* Begin PBXGroup section */
|
|
48
|
-
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
49
|
-
isa = PBXGroup;
|
|
50
|
-
children = (
|
|
51
|
-
134814201AA4EA6300B7C361 /* libScreebModule.a */,
|
|
52
|
-
);
|
|
53
|
-
name = Products;
|
|
54
|
-
sourceTree = "<group>";
|
|
55
|
-
};
|
|
56
|
-
58B511D21A9E6C8500147676 = {
|
|
57
|
-
isa = PBXGroup;
|
|
58
|
-
children = (
|
|
59
|
-
|
|
60
|
-
F4FF95D6245B92E800C19C63 /* ScreebModule.swift */,
|
|
61
|
-
B3E7B5891CC2AC0600A0062D /* ScreebModule.m */,
|
|
62
|
-
F4FF95D5245B92E700C19C63 /* ScreebModule-Bridging-Header.h */,
|
|
63
|
-
|
|
64
|
-
134814211AA4EA7D00B7C361 /* Products */,
|
|
65
|
-
);
|
|
66
|
-
sourceTree = "<group>";
|
|
67
|
-
};
|
|
68
|
-
/* End PBXGroup section */
|
|
69
|
-
|
|
70
|
-
/* Begin PBXNativeTarget section */
|
|
71
|
-
58B511DA1A9E6C8500147676 /* ScreebModule */ = {
|
|
72
|
-
isa = PBXNativeTarget;
|
|
73
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ScreebModule" */;
|
|
74
|
-
buildPhases = (
|
|
75
|
-
58B511D71A9E6C8500147676 /* Sources */,
|
|
76
|
-
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
77
|
-
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
78
|
-
);
|
|
79
|
-
buildRules = (
|
|
80
|
-
);
|
|
81
|
-
dependencies = (
|
|
82
|
-
);
|
|
83
|
-
name = ScreebModule;
|
|
84
|
-
productName = RCTDataManager;
|
|
85
|
-
productReference = 134814201AA4EA6300B7C361 /* libScreebModule.a */;
|
|
86
|
-
productType = "com.apple.product-type.library.static";
|
|
87
|
-
};
|
|
88
|
-
/* End PBXNativeTarget section */
|
|
89
|
-
|
|
90
|
-
/* Begin PBXProject section */
|
|
91
|
-
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
92
|
-
isa = PBXProject;
|
|
93
|
-
attributes = {
|
|
94
|
-
LastUpgradeCheck = 0920;
|
|
95
|
-
ORGANIZATIONNAME = Facebook;
|
|
96
|
-
TargetAttributes = {
|
|
97
|
-
58B511DA1A9E6C8500147676 = {
|
|
98
|
-
CreatedOnToolsVersion = 6.1.1;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ScreebModule" */;
|
|
103
|
-
compatibilityVersion = "Xcode 3.2";
|
|
104
|
-
developmentRegion = English;
|
|
105
|
-
hasScannedForEncodings = 0;
|
|
106
|
-
knownRegions = (
|
|
107
|
-
English,
|
|
108
|
-
en,
|
|
109
|
-
);
|
|
110
|
-
mainGroup = 58B511D21A9E6C8500147676;
|
|
111
|
-
productRefGroup = 58B511D21A9E6C8500147676;
|
|
112
|
-
projectDirPath = "";
|
|
113
|
-
projectRoot = "";
|
|
114
|
-
targets = (
|
|
115
|
-
58B511DA1A9E6C8500147676 /* ScreebModule */,
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
/* End PBXProject section */
|
|
119
|
-
|
|
120
|
-
/* Begin PBXSourcesBuildPhase section */
|
|
121
|
-
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
122
|
-
isa = PBXSourcesBuildPhase;
|
|
123
|
-
buildActionMask = 2147483647;
|
|
124
|
-
files = (
|
|
125
|
-
|
|
126
|
-
F4FF95D7245B92E800C19C63 /* ScreebModule.swift in Sources */,
|
|
127
|
-
B3E7B58A1CC2AC0600A0062D /* ScreebModule.m in Sources */,
|
|
128
|
-
|
|
129
|
-
);
|
|
130
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
131
|
-
};
|
|
132
|
-
/* End PBXSourcesBuildPhase section */
|
|
133
|
-
|
|
134
|
-
/* Begin XCBuildConfiguration section */
|
|
135
|
-
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
136
|
-
isa = XCBuildConfiguration;
|
|
137
|
-
buildSettings = {
|
|
138
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
139
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
140
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
141
|
-
CLANG_ENABLE_MODULES = YES;
|
|
142
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
143
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
144
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
145
|
-
CLANG_WARN_COMMA = YES;
|
|
146
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
147
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
148
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
149
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
150
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
151
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
152
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
153
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
154
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
155
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
156
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
157
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
158
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
159
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
160
|
-
COPY_PHASE_STRIP = NO;
|
|
161
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
162
|
-
ENABLE_TESTABILITY = YES;
|
|
163
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
164
|
-
GCC_DYNAMIC_NO_PIC = NO;
|
|
165
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
166
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
167
|
-
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
168
|
-
"DEBUG=1",
|
|
169
|
-
"$(inherited)",
|
|
170
|
-
);
|
|
171
|
-
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
172
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
173
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
174
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
175
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
176
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
177
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
178
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
179
|
-
MTL_ENABLE_DEBUG_INFO = YES;
|
|
180
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
181
|
-
SDKROOT = iphoneos;
|
|
182
|
-
};
|
|
183
|
-
name = Debug;
|
|
184
|
-
};
|
|
185
|
-
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
186
|
-
isa = XCBuildConfiguration;
|
|
187
|
-
buildSettings = {
|
|
188
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
189
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
190
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
191
|
-
CLANG_ENABLE_MODULES = YES;
|
|
192
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
193
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
194
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
195
|
-
CLANG_WARN_COMMA = YES;
|
|
196
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
197
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
198
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
199
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
200
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
201
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
202
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
203
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
204
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
205
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
206
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
207
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
208
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
209
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
210
|
-
COPY_PHASE_STRIP = YES;
|
|
211
|
-
ENABLE_NS_ASSERTIONS = NO;
|
|
212
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
213
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
214
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
215
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
216
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
217
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
218
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
219
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
220
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
221
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
222
|
-
MTL_ENABLE_DEBUG_INFO = NO;
|
|
223
|
-
SDKROOT = iphoneos;
|
|
224
|
-
VALIDATE_PRODUCT = YES;
|
|
225
|
-
};
|
|
226
|
-
name = Release;
|
|
227
|
-
};
|
|
228
|
-
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
229
|
-
isa = XCBuildConfiguration;
|
|
230
|
-
buildSettings = {
|
|
231
|
-
HEADER_SEARCH_PATHS = (
|
|
232
|
-
"$(inherited)",
|
|
233
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
234
|
-
"$(SRCROOT)/../../../React/**",
|
|
235
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
236
|
-
);
|
|
237
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
238
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
239
|
-
PRODUCT_NAME = ScreebModule;
|
|
240
|
-
SKIP_INSTALL = YES;
|
|
241
|
-
|
|
242
|
-
SWIFT_OBJC_BRIDGING_HEADER = "ScreebModule-Bridging-Header.h";
|
|
243
|
-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
244
|
-
SWIFT_VERSION = 5.0;
|
|
245
|
-
|
|
246
|
-
};
|
|
247
|
-
name = Debug;
|
|
248
|
-
};
|
|
249
|
-
58B511F11A9E6C8500147676 /* Release */ = {
|
|
250
|
-
isa = XCBuildConfiguration;
|
|
251
|
-
buildSettings = {
|
|
252
|
-
HEADER_SEARCH_PATHS = (
|
|
253
|
-
"$(inherited)",
|
|
254
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
255
|
-
"$(SRCROOT)/../../../React/**",
|
|
256
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
257
|
-
);
|
|
258
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
259
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
260
|
-
PRODUCT_NAME = ScreebModule;
|
|
261
|
-
SKIP_INSTALL = YES;
|
|
262
|
-
|
|
263
|
-
SWIFT_OBJC_BRIDGING_HEADER = "ScreebModule-Bridging-Header.h";
|
|
264
|
-
SWIFT_VERSION = 5.0;
|
|
265
|
-
|
|
266
|
-
};
|
|
267
|
-
name = Release;
|
|
268
|
-
};
|
|
269
|
-
/* End XCBuildConfiguration section */
|
|
270
|
-
|
|
271
|
-
/* Begin XCConfigurationList section */
|
|
272
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ScreebModule" */ = {
|
|
273
|
-
isa = XCConfigurationList;
|
|
274
|
-
buildConfigurations = (
|
|
275
|
-
58B511ED1A9E6C8500147676 /* Debug */,
|
|
276
|
-
58B511EE1A9E6C8500147676 /* Release */,
|
|
277
|
-
);
|
|
278
|
-
defaultConfigurationIsVisible = 0;
|
|
279
|
-
defaultConfigurationName = Release;
|
|
280
|
-
};
|
|
281
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ScreebModule" */ = {
|
|
282
|
-
isa = XCConfigurationList;
|
|
283
|
-
buildConfigurations = (
|
|
284
|
-
58B511F01A9E6C8500147676 /* Debug */,
|
|
285
|
-
58B511F11A9E6C8500147676 /* Release */,
|
|
286
|
-
);
|
|
287
|
-
defaultConfigurationIsVisible = 0;
|
|
288
|
-
defaultConfigurationName = Release;
|
|
289
|
-
};
|
|
290
|
-
/* End XCConfigurationList section */
|
|
291
|
-
};
|
|
292
|
-
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
293
|
-
}
|
package/lib/commonjs/index.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initSdk = initSdk;
|
|
4
|
-
exports.setIdentity = setIdentity;
|
|
5
|
-
exports.setProperties = setProperties;
|
|
6
|
-
exports.assignGroup = assignGroup;
|
|
7
|
-
exports.unassignGroup = unassignGroup;
|
|
8
|
-
exports.trackEvent = trackEvent;
|
|
9
|
-
exports.trackScreen = trackScreen;
|
|
10
|
-
exports.startSurvey = startSurvey;
|
|
11
|
-
exports.debug = debug;
|
|
12
|
-
exports.debugTargeting = debugTargeting;
|
|
13
|
-
exports.resetIdentity = resetIdentity;
|
|
14
|
-
exports.closeSdk = closeSdk;
|
|
15
|
-
exports.closeSurvey = closeSurvey;
|
|
16
|
-
const react_native_1 = require("react-native");
|
|
17
|
-
const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` +
|
|
18
|
-
react_native_1.Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) +
|
|
19
|
-
"- You rebuilt the app after installing the package\n" +
|
|
20
|
-
"- You are not using Expo managed workflow\n";
|
|
21
|
-
const ScreebModule = react_native_1.NativeModules.ScreebModule
|
|
22
|
-
? react_native_1.NativeModules.ScreebModule
|
|
23
|
-
: new Proxy({}, {
|
|
24
|
-
get() {
|
|
25
|
-
throw new Error(LINKING_ERROR);
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
let hooksRegistry = new Map();
|
|
29
|
-
function initSdk(androidChannelId, iosChannelId, userId, properties, hooks, isDebugMode, language) {
|
|
30
|
-
const emitter = react_native_1.Platform.OS === "ios"
|
|
31
|
-
? new react_native_1.NativeEventEmitter(react_native_1.NativeModules.ScreebModule)
|
|
32
|
-
: react_native_1.DeviceEventEmitter;
|
|
33
|
-
emitter.addListener("ScreebEvent", handleEvent);
|
|
34
|
-
let mapHooksId = undefined;
|
|
35
|
-
if (hooks != null) {
|
|
36
|
-
mapHooksId = new Object();
|
|
37
|
-
Object.keys(hooks).map((key) => {
|
|
38
|
-
if (key == "version") {
|
|
39
|
-
mapHooksId = { ...mapHooksId, version: hooks[key] };
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
let uuid = Date.now().toString() + Math.random().toString() + key;
|
|
43
|
-
hooksRegistry.set(uuid, hooks[key]);
|
|
44
|
-
mapHooksId = { ...mapHooksId, [key]: uuid };
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (react_native_1.Platform.OS === "ios") {
|
|
49
|
-
return ScreebModule.initSdk(iosChannelId, userId, properties, mapHooksId, isDebugMode, language);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return ScreebModule.initSdk(androidChannelId, userId, properties, mapHooksId, isDebugMode, language);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function setIdentity(userId, properties) {
|
|
56
|
-
return ScreebModule.setIdentity(userId, properties);
|
|
57
|
-
}
|
|
58
|
-
function setProperties(properties) {
|
|
59
|
-
return ScreebModule.setProperties(properties);
|
|
60
|
-
}
|
|
61
|
-
function assignGroup(type, name, properties) {
|
|
62
|
-
return ScreebModule.assignGroup(type, name, properties);
|
|
63
|
-
}
|
|
64
|
-
function unassignGroup(type, name, properties) {
|
|
65
|
-
return ScreebModule.unassignGroup(type, name, properties);
|
|
66
|
-
}
|
|
67
|
-
function trackEvent(name, properties) {
|
|
68
|
-
return ScreebModule.trackEvent(name, properties);
|
|
69
|
-
}
|
|
70
|
-
function trackScreen(name, properties) {
|
|
71
|
-
return ScreebModule.trackScreen(name, properties);
|
|
72
|
-
}
|
|
73
|
-
function startSurvey(surveyId, allowMultipleResponses, hiddenFields, ignoreSurveyStatus, hooks, language) {
|
|
74
|
-
let mapHooksId = undefined;
|
|
75
|
-
if (hooks != undefined) {
|
|
76
|
-
mapHooksId = new Object();
|
|
77
|
-
Object.keys(hooks).map((key) => {
|
|
78
|
-
if (key == "version") {
|
|
79
|
-
mapHooksId = { ...mapHooksId, version: hooks[key] };
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
let uuid = Date.now().toString() + Math.random().toString() + key;
|
|
83
|
-
hooksRegistry.set(uuid, hooks[key]);
|
|
84
|
-
mapHooksId = { ...mapHooksId, [key]: uuid };
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return ScreebModule.startSurvey(surveyId, allowMultipleResponses ?? true, hiddenFields, ignoreSurveyStatus ?? true, mapHooksId, language);
|
|
89
|
-
}
|
|
90
|
-
function debug() {
|
|
91
|
-
return ScreebModule.debug();
|
|
92
|
-
}
|
|
93
|
-
function debugTargeting() {
|
|
94
|
-
return ScreebModule.debugTargeting();
|
|
95
|
-
}
|
|
96
|
-
function resetIdentity() {
|
|
97
|
-
return ScreebModule.resetIdentity();
|
|
98
|
-
}
|
|
99
|
-
function closeSdk() {
|
|
100
|
-
return ScreebModule.closeSdk();
|
|
101
|
-
}
|
|
102
|
-
function closeSurvey() {
|
|
103
|
-
return ScreebModule.closeSurvey();
|
|
104
|
-
}
|
|
105
|
-
function handleEvent(event) {
|
|
106
|
-
if (event?.hookId != null) {
|
|
107
|
-
let hook = hooksRegistry.get(event.hookId);
|
|
108
|
-
if (hook != null) {
|
|
109
|
-
const result = hook(event.payload);
|
|
110
|
-
const parsedPayload = JSON.parse(event.payload);
|
|
111
|
-
const originalHookId = parsedPayload?.hook_id;
|
|
112
|
-
if (originalHookId) {
|
|
113
|
-
// result must be a map to fit with react native allowed types
|
|
114
|
-
// Check if hook is a promise/async function
|
|
115
|
-
if (result instanceof Promise) {
|
|
116
|
-
result
|
|
117
|
-
.then((result) => {
|
|
118
|
-
ScreebModule.onHookResult(originalHookId, { result });
|
|
119
|
-
})
|
|
120
|
-
.catch((error) => {
|
|
121
|
-
console.error(error);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
ScreebModule.onHookResult(originalHookId, { result });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function initSdk(androidChannelId: string, iosChannelId: string, userId?: string, properties?: Map<string, any>, hooks?: any, isDebugMode?: boolean, language?: string): any;
|
|
2
|
-
export declare function setIdentity(userId: string, properties?: Map<string, any>): any;
|
|
3
|
-
export declare function setProperties(properties?: Map<string, any>): any;
|
|
4
|
-
export declare function assignGroup(type: string | null, name: string, properties?: Map<string, any>): any;
|
|
5
|
-
export declare function unassignGroup(type: string | null, name: string, properties?: Map<string, any>): any;
|
|
6
|
-
export declare function trackEvent(name: string, properties?: Map<string, any>): any;
|
|
7
|
-
export declare function trackScreen(name: string, properties?: Map<string, any>): any;
|
|
8
|
-
export declare function startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: Map<string, any>, ignoreSurveyStatus?: boolean, hooks?: any, language?: string): any;
|
|
9
|
-
export declare function debug(): any;
|
|
10
|
-
export declare function debugTargeting(): any;
|
|
11
|
-
export declare function resetIdentity(): any;
|
|
12
|
-
export declare function closeSdk(): any;
|
|
13
|
-
export declare function closeSurvey(): any;
|