@screeb/react-native 0.4.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.
- package/LICENSE +20 -0
- package/README.md +124 -0
- package/android/build.gradle +129 -0
- package/android/gradle.properties +3 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/screebmodule/ScreebModuleModule.kt +82 -0
- package/android/src/main/java/com/screebmodule/ScreebModulePackage.kt +17 -0
- package/ios/ScreebModule-Bridging-Header.h +2 -0
- package/ios/ScreebModule.m +14 -0
- package/ios/ScreebModule.swift +70 -0
- package/ios/ScreebModule.xcodeproj/project.pbxproj +293 -0
- package/lib/commonjs/index.js +48 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/package.json +932 -0
- package/screeb-module.podspec +20 -0
- package/src/index.tsx +42 -0
|
@@ -0,0 +1,293 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.initSdk = initSdk;
|
|
7
|
+
exports.setIdentity = setIdentity;
|
|
8
|
+
exports.setProperties = setProperties;
|
|
9
|
+
exports.trackEvent = trackEvent;
|
|
10
|
+
exports.trackScreen = trackScreen;
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
15
|
+
ios: "- You have run 'pod install'\n",
|
|
16
|
+
default: ''
|
|
17
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
18
|
+
const ScreebModule = _reactNative.NativeModules.ScreebModule ? _reactNative.NativeModules.ScreebModule : new Proxy({}, {
|
|
19
|
+
get() {
|
|
20
|
+
throw new Error(LINKING_ERROR);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function initSdk(androidChannelId, iosChannelId, userId, properties) {
|
|
26
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
27
|
+
return ScreebModule.initSdk(iosChannelId, userId, properties);
|
|
28
|
+
} else {
|
|
29
|
+
return ScreebModule.initSdk(androidChannelId, userId, properties);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function setIdentity(userId, properties) {
|
|
34
|
+
return ScreebModule.setIdentity(userId, properties);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function trackEvent(name, properties) {
|
|
38
|
+
return ScreebModule.trackEvent(name, properties);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function trackScreen(name, properties) {
|
|
42
|
+
return ScreebModule.trackScreen(name, properties);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function setProperties(properties) {
|
|
46
|
+
return ScreebModule.setProperties(properties);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","ScreebModule","NativeModules","Proxy","get","Error","initSdk","androidChannelId","iosChannelId","userId","properties","OS","setIdentity","trackEvent","name","trackScreen","setProperties"],"mappings":";;;;;;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,+EAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,YAAY,GAAGC,2BAAcD,YAAd,GACjBC,2BAAcD,YADG,GAEjB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;;AAWO,SAASU,OAAT,CACHC,gBADG,EAEHC,YAFG,EAGHC,MAHG,EAIHC,UAJG,EAI4B;AACjC,MAAIb,sBAASc,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAOV,YAAY,CAACK,OAAb,CAAqBE,YAArB,EAAmCC,MAAnC,EAA2CC,UAA3C,CAAP;AACD,GAFD,MAEO;AACL,WAAOT,YAAY,CAACK,OAAb,CAAqBC,gBAArB,EAAuCE,MAAvC,EAA+CC,UAA/C,CAAP;AACD;AACF;;AACM,SAASE,WAAT,CAAqBH,MAArB,EAAqCC,UAArC,EAAoE;AACzE,SAAOT,YAAY,CAACW,WAAb,CAAyBH,MAAzB,EAAiCC,UAAjC,CAAP;AACD;;AACM,SAASG,UAAT,CAAoBC,IAApB,EAAkCJ,UAAlC,EAAiE;AACtE,SAAOT,YAAY,CAACY,UAAb,CAAwBC,IAAxB,EAA8BJ,UAA9B,CAAP;AACD;;AACM,SAASK,WAAT,CAAqBD,IAArB,EAAmCJ,UAAnC,EAAkE;AACvE,SAAOT,YAAY,CAACc,WAAb,CAAyBD,IAAzB,EAA+BJ,UAA/B,CAAP;AACD;;AACM,SAASM,aAAT,CAAuBN,UAAvB,EAAsD;AAC3D,SAAOT,YAAY,CAACe,aAAb,CAA2BN,UAA3B,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst ScreebModule = NativeModules.ScreebModule\n ? NativeModules.ScreebModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function initSdk(\n androidChannelId: string,\n iosChannelId: string,\n userId?: string,\n properties?: Map<string, any>) {\n if (Platform.OS === 'ios') {\n return ScreebModule.initSdk(iosChannelId, userId, properties);\n } else {\n return ScreebModule.initSdk(androidChannelId, userId, properties);\n }\n}\nexport function setIdentity(userId: string, properties?: Map<string, any>) {\n return ScreebModule.setIdentity(userId, properties);\n}\nexport function trackEvent(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackEvent(name, properties);\n}\nexport function trackScreen(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackScreen(name, properties);\n}\nexport function setProperties(properties?: Map<string, any>) {\n return ScreebModule.setProperties(properties);\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
6
|
+
const ScreebModule = NativeModules.ScreebModule ? NativeModules.ScreebModule : new Proxy({}, {
|
|
7
|
+
get() {
|
|
8
|
+
throw new Error(LINKING_ERROR);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
});
|
|
12
|
+
export function initSdk(androidChannelId, iosChannelId, userId, properties) {
|
|
13
|
+
if (Platform.OS === 'ios') {
|
|
14
|
+
return ScreebModule.initSdk(iosChannelId, userId, properties);
|
|
15
|
+
} else {
|
|
16
|
+
return ScreebModule.initSdk(androidChannelId, userId, properties);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function setIdentity(userId, properties) {
|
|
20
|
+
return ScreebModule.setIdentity(userId, properties);
|
|
21
|
+
}
|
|
22
|
+
export function trackEvent(name, properties) {
|
|
23
|
+
return ScreebModule.trackEvent(name, properties);
|
|
24
|
+
}
|
|
25
|
+
export function trackScreen(name, properties) {
|
|
26
|
+
return ScreebModule.trackScreen(name, properties);
|
|
27
|
+
}
|
|
28
|
+
export function setProperties(properties) {
|
|
29
|
+
return ScreebModule.setProperties(properties);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","ScreebModule","Proxy","get","Error","initSdk","androidChannelId","iosChannelId","userId","properties","OS","setIdentity","trackEvent","name","trackScreen","setProperties"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,+EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,YAAY,GAAGN,aAAa,CAACM,YAAd,GACjBN,aAAa,CAACM,YADG,GAEjB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,OAAT,CACHC,gBADG,EAEHC,YAFG,EAGHC,MAHG,EAIHC,UAJG,EAI4B;AACjC,MAAIb,QAAQ,CAACc,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAOT,YAAY,CAACI,OAAb,CAAqBE,YAArB,EAAmCC,MAAnC,EAA2CC,UAA3C,CAAP;AACD,GAFD,MAEO;AACL,WAAOR,YAAY,CAACI,OAAb,CAAqBC,gBAArB,EAAuCE,MAAvC,EAA+CC,UAA/C,CAAP;AACD;AACF;AACD,OAAO,SAASE,WAAT,CAAqBH,MAArB,EAAqCC,UAArC,EAAoE;AACzE,SAAOR,YAAY,CAACU,WAAb,CAAyBH,MAAzB,EAAiCC,UAAjC,CAAP;AACD;AACD,OAAO,SAASG,UAAT,CAAoBC,IAApB,EAAkCJ,UAAlC,EAAiE;AACtE,SAAOR,YAAY,CAACW,UAAb,CAAwBC,IAAxB,EAA8BJ,UAA9B,CAAP;AACD;AACD,OAAO,SAASK,WAAT,CAAqBD,IAArB,EAAmCJ,UAAnC,EAAkE;AACvE,SAAOR,YAAY,CAACa,WAAb,CAAyBD,IAAzB,EAA+BJ,UAA/B,CAAP;AACD;AACD,OAAO,SAASM,aAAT,CAAuBN,UAAvB,EAAsD;AAC3D,SAAOR,YAAY,CAACc,aAAb,CAA2BN,UAA3B,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst ScreebModule = NativeModules.ScreebModule\n ? NativeModules.ScreebModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function initSdk(\n androidChannelId: string,\n iosChannelId: string,\n userId?: string,\n properties?: Map<string, any>) {\n if (Platform.OS === 'ios') {\n return ScreebModule.initSdk(iosChannelId, userId, properties);\n } else {\n return ScreebModule.initSdk(androidChannelId, userId, properties);\n }\n}\nexport function setIdentity(userId: string, properties?: Map<string, any>) {\n return ScreebModule.setIdentity(userId, properties);\n}\nexport function trackEvent(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackEvent(name, properties);\n}\nexport function trackScreen(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackScreen(name, properties);\n}\nexport function setProperties(properties?: Map<string, any>) {\n return ScreebModule.setProperties(properties);\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function initSdk(androidChannelId: string, iosChannelId: string, userId?: string, properties?: Map<string, any>): any;
|
|
2
|
+
export declare function setIdentity(userId: string, properties?: Map<string, any>): any;
|
|
3
|
+
export declare function trackEvent(name: string, properties?: Map<string, any>): any;
|
|
4
|
+
export declare function trackScreen(name: string, properties?: Map<string, any>): any;
|
|
5
|
+
export declare function setProperties(properties?: Map<string, any>): any;
|