@sentiance-react-native/core 6.0.0-beta.9
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 -0
- package/android/build.gradle +17 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +2 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/package-json-reader.gradle +62 -0
- package/android/sentiance-version-finder.gradle +17 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/SentianceConverter.java +364 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/SentianceEmitter.java +46 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/SentianceHelper.java +207 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/SentianceModule.java +529 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/SentiancePackage.java +30 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/UserLinker.java +34 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/base/AbstractSentianceEmitter.java +59 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/base/AbstractSentianceModule.java +33 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/utils/ErrorCodes.java +16 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/utils/SentianceUtils.java +160 -0
- package/android/src/main/java/com/sentiance/react/bridge/core/utils/UserCreationCompletionHandler.java +31 -0
- package/ios/RNSentianceCore+Converter.h +46 -0
- package/ios/RNSentianceCore+Converter.m +986 -0
- package/ios/RNSentianceCore.h +29 -0
- package/ios/RNSentianceCore.m +1036 -0
- package/ios/RNSentianceCore.podspec +24 -0
- package/ios/RNSentianceCore.xcodeproj/project.pbxproj +290 -0
- package/ios/RNSentianceErrorCodes.h +20 -0
- package/ios/RNSentianceErrorCodes.m +22 -0
- package/ios/RNSentianceHelper.h +31 -0
- package/ios/RNSentianceHelper.m +38 -0
- package/ios/RNSentianceNativeInitialization.h +6 -0
- package/ios/RNSentianceNativeInitialization.m +56 -0
- package/lib/core.js +64 -0
- package/lib/index.d.ts +198 -0
- package/lib/index.js +194 -0
- package/lib/utils.js +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
package = JSON.parse(File.read(File.join(__dir__, '../package.json')))
|
|
3
|
+
sentiance_sdk_version = package['sdkVersions']['ios']['sentiance']
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "RNSentianceCore"
|
|
7
|
+
s.version = "6.0.0"
|
|
8
|
+
s.summary = "RNSentianceCore"
|
|
9
|
+
s.description = <<-DESC
|
|
10
|
+
RNSentianceCore
|
|
11
|
+
DESC
|
|
12
|
+
s.homepage = "https://developers.sentiance.com/docs"
|
|
13
|
+
s.license = "MIT"
|
|
14
|
+
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
|
|
15
|
+
s.author = { "author" => "sdk@sentiance.com" }
|
|
16
|
+
s.platform = :ios, "9.0"
|
|
17
|
+
s.source = { :git => "https://github.com/sentiance/react-native-sentiance.git", :tag => "master" }
|
|
18
|
+
s.source_files = "*.{h,m}"
|
|
19
|
+
s.requires_arc = true
|
|
20
|
+
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/SENTSDK' }
|
|
21
|
+
|
|
22
|
+
s.dependency "React"
|
|
23
|
+
s.dependency "SENTSDK", sentiance_sdk_version
|
|
24
|
+
end
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
03AE26FE282A80E90085E48F /* RNSentianceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AE26FC282A80E90085E48F /* RNSentianceHelper.m */; };
|
|
11
|
+
03AE2705282A80FE0085E48F /* RNSentianceErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AE26FF282A80FD0085E48F /* RNSentianceErrorCodes.m */; };
|
|
12
|
+
03AE2706282A80FE0085E48F /* RNSentianceCore.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AE2701282A80FD0085E48F /* RNSentianceCore.m */; };
|
|
13
|
+
03AE2707282A80FE0085E48F /* RNSentianceCore+Converter.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AE2704282A80FD0085E48F /* RNSentianceCore+Converter.m */; };
|
|
14
|
+
9AE9AE342527BDFA0070A307 /* RNSentianceNativeInitialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE9AE332527BDFA0070A307 /* RNSentianceNativeInitialization.m */; };
|
|
15
|
+
/* End PBXBuildFile section */
|
|
16
|
+
|
|
17
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
18
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
19
|
+
isa = PBXCopyFilesBuildPhase;
|
|
20
|
+
buildActionMask = 2147483647;
|
|
21
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
22
|
+
dstSubfolderSpec = 16;
|
|
23
|
+
files = (
|
|
24
|
+
);
|
|
25
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
26
|
+
};
|
|
27
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
28
|
+
|
|
29
|
+
/* Begin PBXFileReference section */
|
|
30
|
+
03AE26FC282A80E90085E48F /* RNSentianceHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSentianceHelper.m; sourceTree = "<group>"; };
|
|
31
|
+
03AE26FD282A80E90085E48F /* RNSentianceHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSentianceHelper.h; sourceTree = "<group>"; };
|
|
32
|
+
03AE26FF282A80FD0085E48F /* RNSentianceErrorCodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSentianceErrorCodes.m; sourceTree = "<group>"; };
|
|
33
|
+
03AE2700282A80FD0085E48F /* RNSentianceCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSentianceCore.h; sourceTree = "<group>"; };
|
|
34
|
+
03AE2701282A80FD0085E48F /* RNSentianceCore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSentianceCore.m; sourceTree = "<group>"; };
|
|
35
|
+
03AE2702282A80FD0085E48F /* RNSentianceErrorCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSentianceErrorCodes.h; sourceTree = "<group>"; };
|
|
36
|
+
03AE2703282A80FD0085E48F /* RNSentianceCore+Converter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RNSentianceCore+Converter.h"; sourceTree = "<group>"; };
|
|
37
|
+
03AE2704282A80FD0085E48F /* RNSentianceCore+Converter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RNSentianceCore+Converter.m"; sourceTree = "<group>"; };
|
|
38
|
+
134814201AA4EA6300B7C361 /* libRNSentianceCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNSentianceCore.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
39
|
+
9AE9AE322527BDD90070A307 /* RNSentianceNativeInitialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNSentianceNativeInitialization.h; sourceTree = "<group>"; };
|
|
40
|
+
9AE9AE332527BDFA0070A307 /* RNSentianceNativeInitialization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNSentianceNativeInitialization.m; sourceTree = "<group>"; };
|
|
41
|
+
/* End PBXFileReference section */
|
|
42
|
+
|
|
43
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
44
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
45
|
+
isa = PBXFrameworksBuildPhase;
|
|
46
|
+
buildActionMask = 2147483647;
|
|
47
|
+
files = (
|
|
48
|
+
);
|
|
49
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
50
|
+
};
|
|
51
|
+
/* End PBXFrameworksBuildPhase section */
|
|
52
|
+
|
|
53
|
+
/* Begin PBXGroup section */
|
|
54
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
55
|
+
isa = PBXGroup;
|
|
56
|
+
children = (
|
|
57
|
+
134814201AA4EA6300B7C361 /* libRNSentianceCore.a */,
|
|
58
|
+
);
|
|
59
|
+
name = Products;
|
|
60
|
+
sourceTree = "<group>";
|
|
61
|
+
};
|
|
62
|
+
58B511D21A9E6C8500147676 = {
|
|
63
|
+
isa = PBXGroup;
|
|
64
|
+
children = (
|
|
65
|
+
03AE2702282A80FD0085E48F /* RNSentianceErrorCodes.h */,
|
|
66
|
+
03AE26FF282A80FD0085E48F /* RNSentianceErrorCodes.m */,
|
|
67
|
+
03AE2700282A80FD0085E48F /* RNSentianceCore.h */,
|
|
68
|
+
03AE2701282A80FD0085E48F /* RNSentianceCore.m */,
|
|
69
|
+
03AE2703282A80FD0085E48F /* RNSentianceCore+Converter.h */,
|
|
70
|
+
03AE2704282A80FD0085E48F /* RNSentianceCore+Converter.m */,
|
|
71
|
+
03AE26FD282A80E90085E48F /* RNSentianceHelper.h */,
|
|
72
|
+
03AE26FC282A80E90085E48F /* RNSentianceHelper.m */,
|
|
73
|
+
9AE9AE332527BDFA0070A307 /* RNSentianceNativeInitialization.m */,
|
|
74
|
+
9AE9AE322527BDD90070A307 /* RNSentianceNativeInitialization.h */,
|
|
75
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
76
|
+
);
|
|
77
|
+
sourceTree = "<group>";
|
|
78
|
+
};
|
|
79
|
+
/* End PBXGroup section */
|
|
80
|
+
|
|
81
|
+
/* Begin PBXNativeTarget section */
|
|
82
|
+
58B511DA1A9E6C8500147676 /* RNSentianceCore */ = {
|
|
83
|
+
isa = PBXNativeTarget;
|
|
84
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNSentianceCore" */;
|
|
85
|
+
buildPhases = (
|
|
86
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
87
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
88
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
89
|
+
);
|
|
90
|
+
buildRules = (
|
|
91
|
+
);
|
|
92
|
+
dependencies = (
|
|
93
|
+
);
|
|
94
|
+
name = RNSentianceCore;
|
|
95
|
+
productName = RCTDataManager;
|
|
96
|
+
productReference = 134814201AA4EA6300B7C361 /* libRNSentianceCore.a */;
|
|
97
|
+
productType = "com.apple.product-type.library.static";
|
|
98
|
+
};
|
|
99
|
+
/* End PBXNativeTarget section */
|
|
100
|
+
|
|
101
|
+
/* Begin PBXProject section */
|
|
102
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
103
|
+
isa = PBXProject;
|
|
104
|
+
attributes = {
|
|
105
|
+
LastUpgradeCheck = 0830;
|
|
106
|
+
ORGANIZATIONNAME = Facebook;
|
|
107
|
+
TargetAttributes = {
|
|
108
|
+
58B511DA1A9E6C8500147676 = {
|
|
109
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNSentianceCore" */;
|
|
114
|
+
compatibilityVersion = "Xcode 3.2";
|
|
115
|
+
developmentRegion = English;
|
|
116
|
+
hasScannedForEncodings = 0;
|
|
117
|
+
knownRegions = (
|
|
118
|
+
English,
|
|
119
|
+
en,
|
|
120
|
+
);
|
|
121
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
122
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
123
|
+
projectDirPath = "";
|
|
124
|
+
projectRoot = "";
|
|
125
|
+
targets = (
|
|
126
|
+
58B511DA1A9E6C8500147676 /* RNSentianceCore */,
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
/* End PBXProject section */
|
|
130
|
+
|
|
131
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
132
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
133
|
+
isa = PBXSourcesBuildPhase;
|
|
134
|
+
buildActionMask = 2147483647;
|
|
135
|
+
files = (
|
|
136
|
+
03AE2707282A80FE0085E48F /* RNSentianceCore+Converter.m in Sources */,
|
|
137
|
+
03AE26FE282A80E90085E48F /* RNSentianceHelper.m in Sources */,
|
|
138
|
+
03AE2706282A80FE0085E48F /* RNSentianceCore.m in Sources */,
|
|
139
|
+
9AE9AE342527BDFA0070A307 /* RNSentianceNativeInitialization.m in Sources */,
|
|
140
|
+
03AE2705282A80FE0085E48F /* RNSentianceErrorCodes.m in Sources */,
|
|
141
|
+
);
|
|
142
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
143
|
+
};
|
|
144
|
+
/* End PBXSourcesBuildPhase section */
|
|
145
|
+
|
|
146
|
+
/* Begin XCBuildConfiguration section */
|
|
147
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
148
|
+
isa = XCBuildConfiguration;
|
|
149
|
+
buildSettings = {
|
|
150
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
151
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
152
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
153
|
+
CLANG_ENABLE_MODULES = YES;
|
|
154
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
155
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
156
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
157
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
158
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
159
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
160
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
161
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
162
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
163
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
164
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
165
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
166
|
+
COPY_PHASE_STRIP = NO;
|
|
167
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
168
|
+
ENABLE_TESTABILITY = YES;
|
|
169
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
170
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
171
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
172
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
173
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
174
|
+
"DEBUG=1",
|
|
175
|
+
"$(inherited)",
|
|
176
|
+
);
|
|
177
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
178
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
179
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
180
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
181
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
182
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
183
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
184
|
+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
|
185
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
186
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
187
|
+
SDKROOT = iphoneos;
|
|
188
|
+
};
|
|
189
|
+
name = Debug;
|
|
190
|
+
};
|
|
191
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
192
|
+
isa = XCBuildConfiguration;
|
|
193
|
+
buildSettings = {
|
|
194
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
195
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
196
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
197
|
+
CLANG_ENABLE_MODULES = YES;
|
|
198
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
199
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
200
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
201
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
202
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
203
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
204
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
205
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
206
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
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 = 12.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 = (
|
|
239
|
+
"-ObjC",
|
|
240
|
+
"-all_load",
|
|
241
|
+
);
|
|
242
|
+
PRODUCT_NAME = RNSentianceCore;
|
|
243
|
+
SKIP_INSTALL = YES;
|
|
244
|
+
};
|
|
245
|
+
name = Debug;
|
|
246
|
+
};
|
|
247
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
248
|
+
isa = XCBuildConfiguration;
|
|
249
|
+
buildSettings = {
|
|
250
|
+
HEADER_SEARCH_PATHS = (
|
|
251
|
+
"$(inherited)",
|
|
252
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
253
|
+
"$(SRCROOT)/../../../React/**",
|
|
254
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
255
|
+
);
|
|
256
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
257
|
+
OTHER_LDFLAGS = (
|
|
258
|
+
"-ObjC",
|
|
259
|
+
"-all_load",
|
|
260
|
+
);
|
|
261
|
+
PRODUCT_NAME = RNSentianceCore;
|
|
262
|
+
SKIP_INSTALL = YES;
|
|
263
|
+
};
|
|
264
|
+
name = Release;
|
|
265
|
+
};
|
|
266
|
+
/* End XCBuildConfiguration section */
|
|
267
|
+
|
|
268
|
+
/* Begin XCConfigurationList section */
|
|
269
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNSentianceCore" */ = {
|
|
270
|
+
isa = XCConfigurationList;
|
|
271
|
+
buildConfigurations = (
|
|
272
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
273
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
274
|
+
);
|
|
275
|
+
defaultConfigurationIsVisible = 0;
|
|
276
|
+
defaultConfigurationName = Release;
|
|
277
|
+
};
|
|
278
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNSentianceCore" */ = {
|
|
279
|
+
isa = XCConfigurationList;
|
|
280
|
+
buildConfigurations = (
|
|
281
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
282
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
283
|
+
);
|
|
284
|
+
defaultConfigurationIsVisible = 0;
|
|
285
|
+
defaultConfigurationName = Release;
|
|
286
|
+
};
|
|
287
|
+
/* End XCConfigurationList section */
|
|
288
|
+
};
|
|
289
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
290
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ErrorCodes.h
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Hassan Shakeel on 05/05/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
extern NSString * const ESDKMissingParams;
|
|
9
|
+
extern NSString * const ESDKGetTokenError;
|
|
10
|
+
extern NSString * const ESDKStartTripError;
|
|
11
|
+
extern NSString * const ESDKStopTripError;
|
|
12
|
+
extern NSString * const ESDKNotInitialized;
|
|
13
|
+
extern NSString * const ESDKSubmitDetectionsError;
|
|
14
|
+
extern NSString * const ESDKEnableDetectionsError;
|
|
15
|
+
extern NSString * const ESDKDisableDetectionsError;
|
|
16
|
+
extern NSString * const ESDKUserLinkError;
|
|
17
|
+
extern NSString * const ESDKUserLinkAuthCodeError;
|
|
18
|
+
extern NSString * const ESDKCreateUserError;
|
|
19
|
+
extern NSString * const ESDKResetError;
|
|
20
|
+
extern NSString * const ESDKRequestUserContextError;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ErrorCodes.m
|
|
3
|
+
// RNSentiance
|
|
4
|
+
//
|
|
5
|
+
// Created by Hassan Shakeel on 05/05/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "RNSentianceErrorCodes.h"
|
|
9
|
+
|
|
10
|
+
NSString * const ESDKMissingParams = @"E_SDK_MISSING_PARAMS";
|
|
11
|
+
NSString * const ESDKGetTokenError = @"E_SDK_GET_TOKEN_ERROR";
|
|
12
|
+
NSString * const ESDKStartTripError = @"E_SDK_START_TRIP_ERROR";
|
|
13
|
+
NSString * const ESDKStopTripError = @"E_SDK_STOP_TRIP_ERROR";
|
|
14
|
+
NSString * const ESDKNotInitialized = @"E_SDK_NOT_INITIALIZED";
|
|
15
|
+
NSString * const ESDKSubmitDetectionsError = @"E_SDK_SUBMIT_DETECTIONS_ERROR";
|
|
16
|
+
NSString * const ESDKEnableDetectionsError = @"E_SDK_ENABLE_DETECTIONS_ERROR";
|
|
17
|
+
NSString * const ESDKDisableDetectionsError = @"E_SDK_DISABLE_DETECTIONS_ERROR";
|
|
18
|
+
NSString * const ESDKUserLinkError = @"E_SDK_USER_LINK_ERROR";
|
|
19
|
+
NSString * const ESDKUserLinkAuthCodeError = @"E_SDK_USER_LINK_AUTH_CODE_ERROR";
|
|
20
|
+
NSString * const ESDKCreateUserError = @"E_SDK_CREATE_USER_ERROR";
|
|
21
|
+
NSString * const ESDKResetError = @"E_SDK_RESET_ERROR";
|
|
22
|
+
NSString * const ESDKRequestUserContextError = @"E_SDK_REQUEST_USER_CONTEXT_ERROR";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SentianceHelper.h
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Hassan Shakeel on 10/05/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "RNSentianceCore.h"
|
|
10
|
+
#import <SENTSDK/SENTSDK.h>
|
|
11
|
+
#import <React/RCTBridge.h>
|
|
12
|
+
#import <React/RCTBridgeModule.h>
|
|
13
|
+
#import <React/RCTEventEmitter.h>
|
|
14
|
+
#import "RNSentianceCore+Converter.h"
|
|
15
|
+
|
|
16
|
+
@interface RNSentianceHelper: NSObject
|
|
17
|
+
|
|
18
|
+
- (SENTInitializationResult *)initializeSDKWithLaunchOptions:(nullable NSDictionary *)launchOptions
|
|
19
|
+
NS_SWIFT_NAME(initializeSDK(launchOptions:));
|
|
20
|
+
|
|
21
|
+
- (SENTInitializationResult *)initializeSDKWithPlatformUrl:(NSString *)platformUrl
|
|
22
|
+
launchOptions:(nullable NSDictionary *)launchOptions
|
|
23
|
+
NS_SWIFT_NAME(initializeSDK(platformUrl:launchOptions:));
|
|
24
|
+
|
|
25
|
+
- (SENTInitializationResult *)initializeSDKWithPlatformUrl:(NSString *)platformUrl
|
|
26
|
+
isAppSessionDataCollectionAllowed:(BOOL *)isAppSessionDataCollectionAllowed
|
|
27
|
+
launchOptions:(nullable NSDictionary *)launchOptions
|
|
28
|
+
NS_SWIFT_NAME(initializeSDK(platformUrl:isAppSessionDataCollectionAllowed:launchOptions:));
|
|
29
|
+
|
|
30
|
+
@end
|
|
31
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SentianceHelper.m
|
|
3
|
+
// DoubleConversion
|
|
4
|
+
//
|
|
5
|
+
// Created by Hassan Shakeel on 10/05/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "RNSentianceHelper.h"
|
|
10
|
+
#import <SENTSDK/SENTSDK.h>
|
|
11
|
+
#import <React/RCTBridge.h>
|
|
12
|
+
#import <React/RCTBridgeModule.h>
|
|
13
|
+
#import <React/RCTEventEmitter.h>
|
|
14
|
+
#import "RNSentianceCore+Converter.h"
|
|
15
|
+
|
|
16
|
+
@implementation RNSentianceHelper
|
|
17
|
+
|
|
18
|
+
- (SENTInitializationResult *)initializeSDKWithLaunchOptions:(nullable NSDictionary *)launchOptions {
|
|
19
|
+
return [self initializeSDKWithPlatformUrl:nil isAppSessionDataCollectionAllowed:NO launchOptions:nil];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (SENTInitializationResult *)initializeSDKWithPlatformUrl:(NSString *)platformUrl
|
|
23
|
+
launchOptions:(nullable NSDictionary *)launchOptions {
|
|
24
|
+
return [self initializeSDKWithPlatformUrl:platformUrl isAppSessionDataCollectionAllowed:NO launchOptions:launchOptions];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
- (SENTInitializationResult *)initializeSDKWithPlatformUrl:(NSString *)platformUrl
|
|
29
|
+
isAppSessionDataCollectionAllowed:(BOOL *)isAppSessionDataCollectionAllowed
|
|
30
|
+
launchOptions:(nullable NSDictionary *)launchOptions {
|
|
31
|
+
SENTOptions *options = [[SENTOptions alloc] init];
|
|
32
|
+
options.platformUrl = platformUrl;
|
|
33
|
+
options.isAppSessionDataCollectionAllowed = isAppSessionDataCollectionAllowed;
|
|
34
|
+
return [[Sentiance sharedInstance] initializeWithOptions:options launchOptions:launchOptions];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#import "RNSentianceNativeInitialization.h"
|
|
2
|
+
|
|
3
|
+
@implementation RNSentianceNativeInitialization
|
|
4
|
+
|
|
5
|
+
+ (RNSentianceNativeInitialization *)sharedObject {
|
|
6
|
+
static RNSentianceNativeInitialization *rnSentianceNativeInitialization = nil;
|
|
7
|
+
static dispatch_once_t onceToken;
|
|
8
|
+
dispatch_once(&onceToken, ^{
|
|
9
|
+
rnSentianceNativeInitialization = [[self alloc] init];
|
|
10
|
+
});
|
|
11
|
+
return rnSentianceNativeInitialization;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
- (NSString *) getRNSentianceDirectoryPath:(NSString *) docDir {
|
|
15
|
+
return [docDir stringByAppendingPathComponent:@"RNSentiance"];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
- (NSString *) getNativeInitializationFilePath:(NSFileManager *)fileManager {
|
|
19
|
+
NSString *docDir = [[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject].path;
|
|
20
|
+
NSString *sentianceDir = [self getRNSentianceDirectoryPath:docDir];
|
|
21
|
+
NSString* path = [sentianceDir stringByAppendingPathComponent:@"rnsentiance_initialize_natively"];
|
|
22
|
+
return path;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (BOOL)isFlagFileExists {
|
|
26
|
+
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
27
|
+
NSString* path = [self getNativeInitializationFilePath:fileManager];
|
|
28
|
+
if([fileManager fileExistsAtPath:path]) {
|
|
29
|
+
return YES;
|
|
30
|
+
} else {
|
|
31
|
+
return NO;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)createFlagFile:(NSError **)error {
|
|
36
|
+
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
37
|
+
NSString *docDir = [[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject].path;
|
|
38
|
+
NSString *sentianceDir = [self getRNSentianceDirectoryPath:docDir];
|
|
39
|
+
NSString* path = [self getNativeInitializationFilePath:fileManager];
|
|
40
|
+
|
|
41
|
+
[fileManager createDirectoryAtPath:sentianceDir withIntermediateDirectories:YES
|
|
42
|
+
attributes:@{NSFileProtectionKey:NSFileProtectionNone}
|
|
43
|
+
error:error];
|
|
44
|
+
|
|
45
|
+
if (*error == nil) {
|
|
46
|
+
[fileManager createFileAtPath:path contents:nil attributes:@{NSFileProtectionKey:NSFileProtectionNone}];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
- (void)removeFlagFile:(NSError **)error {
|
|
51
|
+
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
52
|
+
NSString* path = [self getNativeInitializationFilePath:fileManager];
|
|
53
|
+
[fileManager removeItemAtPath:path error:error];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@end
|
package/lib/core.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const {NativeModules, NativeEventEmitter} = require("react-native");
|
|
2
|
+
const {varToString} = require("./utils");
|
|
3
|
+
const {SentianceCore} = NativeModules;
|
|
4
|
+
|
|
5
|
+
const SDK_STATUS_UPDATE_EVENT = "SENTIANCE_STATUS_UPDATE_EVENT";
|
|
6
|
+
const SDK_USER_LINK_EVENT = "SENTIANCE_USER_LINK_EVENT";
|
|
7
|
+
const SDK_ON_DETECTIONS_ENABLED_EVENT = "SENTIANCE_ON_DETECTIONS_ENABLED_EVENT";
|
|
8
|
+
const SDK_USER_ACTIVITY_UPDATE_EVENT = "SENTIANCE_USER_ACTIVITY_UPDATE_EVENT";
|
|
9
|
+
const SDK_ON_TRIP_TIMED_OUT_EVENT = "SENTIANCE_ON_TRIP_TIMED_OUT_EVENT";
|
|
10
|
+
|
|
11
|
+
if (!SentianceCore) {
|
|
12
|
+
const nativeModuleName = varToString({SentianceCore});
|
|
13
|
+
throw `Could not locate the native ${nativeModuleName} module.
|
|
14
|
+
Make sure that your native code is properly linked, and that the module name you specified is correct.`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const SENTIANCE_EMITTER = new NativeEventEmitter(SentianceCore);
|
|
18
|
+
|
|
19
|
+
const _addSdkStatusUpdateListener = async (onSdkStatusUpdated) => {
|
|
20
|
+
await SentianceCore.listenSdkStatusUpdates();
|
|
21
|
+
return SENTIANCE_EMITTER.addListener(SDK_STATUS_UPDATE_EVENT, (sdkStatus) => {
|
|
22
|
+
onSdkStatusUpdated(sdkStatus);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const _addUserLinkListener = async (linker) => {
|
|
27
|
+
const subscription = SENTIANCE_EMITTER.addListener(SDK_USER_LINK_EVENT, async (data) => {
|
|
28
|
+
const {installId} = data;
|
|
29
|
+
const linkingResult = await linker(installId);
|
|
30
|
+
if (typeof linkingResult != "boolean") {
|
|
31
|
+
console.error('Expected linker result of type boolean, got: ' + typeof linkingResult);
|
|
32
|
+
SentianceCore.userLinkCallback(false);
|
|
33
|
+
} else {
|
|
34
|
+
SentianceCore.userLinkCallback(linkingResult);
|
|
35
|
+
}
|
|
36
|
+
subscription.remove();
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const _addOnDetectionsEnabledListener = async (onDetectionsEnabled) => {
|
|
41
|
+
return SENTIANCE_EMITTER.addListener(SDK_ON_DETECTIONS_ENABLED_EVENT, (data) => {
|
|
42
|
+
onDetectionsEnabled(data);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const _addSdkUserActivityUpdateListener = async (onUserActivityUpdated) => {
|
|
47
|
+
await SentianceCore.listenUserActivityUpdates();
|
|
48
|
+
return SENTIANCE_EMITTER.addListener(SDK_USER_ACTIVITY_UPDATE_EVENT, (data) => {
|
|
49
|
+
onUserActivityUpdated(data);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const _addTripTimeoutListener = async (onTripTimedOut) => {
|
|
54
|
+
await SentianceCore.listenTripTimeout();
|
|
55
|
+
return SENTIANCE_EMITTER.addListener(SDK_ON_TRIP_TIMED_OUT_EVENT, onTripTimedOut);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
SentianceCore._addSdkStatusUpdateListener = _addSdkStatusUpdateListener;
|
|
59
|
+
SentianceCore._addUserLinkListener = _addUserLinkListener;
|
|
60
|
+
SentianceCore._addOnDetectionsEnabledListener = _addOnDetectionsEnabledListener;
|
|
61
|
+
SentianceCore._addSdkUserActivityUpdateListener = _addSdkUserActivityUpdateListener;
|
|
62
|
+
SentianceCore._addTripTimeoutListener = _addTripTimeoutListener;
|
|
63
|
+
|
|
64
|
+
export default SentianceCore;
|