react-native-clarity 0.0.4 → 1.0.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 -20
- package/README.md +16 -3
- package/android/build.gradle +1 -1
- package/android/gradle.properties +7 -6
- package/android/src/main/java/com/microsoft/clarity/reactnative/ClarityModule.kt +5 -0
- package/ios/Clarity.h +12 -12
- package/ios/Clarity.mm +15 -15
- package/ios/Clarity.xcodeproj/project.pbxproj +274 -274
- package/lib/commonjs/index.js +19 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +18 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-clarity.podspec +35 -35
- package/src/index.tsx +22 -6
- package/ios/Clarity.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Microsoft - Clarity
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
in the Software without restriction, including without limitation the rights
|
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
furnished to do so, subject to the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Microsoft - Clarity
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -11,9 +11,7 @@ npm install react-native-clarity
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import { initialize } from 'react-native-clarity';
|
|
15
|
-
import { setCustomUserId } from 'react-native-clarity';
|
|
16
|
-
import { getCurrentSessionId } from 'react-native-clarity';
|
|
14
|
+
import { initialize, setCustomUserId, getCurrentSessionId, setCurrentScreenName } from 'react-native-clarity';
|
|
17
15
|
|
|
18
16
|
// Initialize Clarity.
|
|
19
17
|
initialize("<ProjectId>");
|
|
@@ -23,6 +21,21 @@ setCustomUserId("react@native.com");
|
|
|
23
21
|
|
|
24
22
|
// Get current session id to correlate with other tools.
|
|
25
23
|
getCurrentSessionId().then((id) => {...});
|
|
24
|
+
|
|
25
|
+
// Setting the current screen name when using React Navigation
|
|
26
|
+
import { ..., useFocusEffect } from '@react-navigation/native';
|
|
27
|
+
|
|
28
|
+
const HomeScreen = ({...}) => {
|
|
29
|
+
useFocusEffect(
|
|
30
|
+
React.useCallback(() => {
|
|
31
|
+
setCurrentScreenName("Home");
|
|
32
|
+
|
|
33
|
+
// To clear the current screen name when the screen goes out of focus:
|
|
34
|
+
return () => { setCurrentScreenName(undefined); }
|
|
35
|
+
}, [])
|
|
36
|
+
);
|
|
37
|
+
...
|
|
38
|
+
};
|
|
26
39
|
```
|
|
27
40
|
|
|
28
41
|
### Initialization arguments
|
package/android/build.gradle
CHANGED
|
@@ -69,7 +69,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
69
69
|
dependencies {
|
|
70
70
|
implementation "com.facebook.react:react-native:+"
|
|
71
71
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
72
|
-
implementation "com.microsoft.clarity:clarity:1.3.
|
|
72
|
+
implementation "com.microsoft.clarity:clarity:1.3.3"
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
if (isNewArchitectureEnabled()) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
#make sure these are acutally used
|
|
2
|
+
Clarity_kotlinVersion=1.7.0
|
|
3
|
+
Clarity_minSdkVersion=21
|
|
4
|
+
Clarity_targetSdkVersion=33
|
|
5
|
+
Clarity_compileSdkVersion=33
|
|
6
|
+
Clarity_ndkversion=21.4.7075529
|
|
7
|
+
android.useAndroidX=true
|
|
@@ -46,6 +46,11 @@ class ClarityModule(reactContext: ReactApplicationContext) :
|
|
|
46
46
|
promise.resolve(Clarity.getCurrentSessionId())
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
@ReactMethod
|
|
50
|
+
fun setCurrentScreenName(screenName: String?, promise: Promise) {
|
|
51
|
+
promise.resolve(Clarity.setCurrentScreenName(screenName))
|
|
52
|
+
}
|
|
53
|
+
|
|
49
54
|
private fun readableArrayToList(arr: ReadableArray): List<String> {
|
|
50
55
|
val ret = mutableListOf<String>()
|
|
51
56
|
|
package/ios/Clarity.h
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
-
#import "RNClaritySpec.h"
|
|
4
|
-
|
|
5
|
-
@interface Clarity : NSObject <NativeClaritySpec>
|
|
6
|
-
#else
|
|
7
|
-
#import <React/RCTBridgeModule.h>
|
|
8
|
-
|
|
9
|
-
@interface Clarity : NSObject <RCTBridgeModule>
|
|
10
|
-
#endif
|
|
11
|
-
|
|
12
|
-
@end
|
|
1
|
+
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
#import "RNClaritySpec.h"
|
|
4
|
+
|
|
5
|
+
@interface Clarity : NSObject <NativeClaritySpec>
|
|
6
|
+
#else
|
|
7
|
+
#import <React/RCTBridgeModule.h>
|
|
8
|
+
|
|
9
|
+
@interface Clarity : NSObject <RCTBridgeModule>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
@end
|
package/ios/Clarity.mm
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#import "Clarity.h"
|
|
2
|
-
|
|
3
|
-
@implementation Clarity
|
|
4
|
-
RCT_EXPORT_MODULE()
|
|
5
|
-
|
|
6
|
-
// Don't compile this code when we build for the old architecture.
|
|
7
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
9
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
10
|
-
{
|
|
11
|
-
return std::make_shared<facebook::react::NativeClaritySpecJSI>(params);
|
|
12
|
-
}
|
|
13
|
-
#endif
|
|
14
|
-
|
|
15
|
-
@end
|
|
1
|
+
#import "Clarity.h"
|
|
2
|
+
|
|
3
|
+
@implementation Clarity
|
|
4
|
+
RCT_EXPORT_MODULE()
|
|
5
|
+
|
|
6
|
+
// Don't compile this code when we build for the old architecture.
|
|
7
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
9
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
10
|
+
{
|
|
11
|
+
return std::make_shared<facebook::react::NativeClaritySpecJSI>(params);
|
|
12
|
+
}
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
@end
|
|
@@ -1,274 +1,274 @@
|
|
|
1
|
-
// !$*UTF8*$!
|
|
2
|
-
{
|
|
3
|
-
archiveVersion = 1;
|
|
4
|
-
classes = {
|
|
5
|
-
};
|
|
6
|
-
objectVersion = 46;
|
|
7
|
-
objects = {
|
|
8
|
-
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
5E555C0D2413F4C50049A1A2 /* Clarity.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* Clarity.m */; };
|
|
11
|
-
/* End PBXBuildFile section */
|
|
12
|
-
|
|
13
|
-
/* Begin PBXCopyFilesBuildPhase section */
|
|
14
|
-
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
15
|
-
isa = PBXCopyFilesBuildPhase;
|
|
16
|
-
buildActionMask = 2147483647;
|
|
17
|
-
dstPath = "include/$(PRODUCT_NAME)";
|
|
18
|
-
dstSubfolderSpec = 16;
|
|
19
|
-
files = (
|
|
20
|
-
);
|
|
21
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
22
|
-
};
|
|
23
|
-
/* End PBXCopyFilesBuildPhase section */
|
|
24
|
-
|
|
25
|
-
/* Begin PBXFileReference section */
|
|
26
|
-
134814201AA4EA6300B7C361 /* libClarity.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libClarity.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
27
|
-
B3E7B5881CC2AC0600A0062D /* Clarity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clarity.h; sourceTree = "<group>"; };
|
|
28
|
-
B3E7B5891CC2AC0600A0062D /* Clarity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Clarity.m; sourceTree = "<group>"; };
|
|
29
|
-
/* End PBXFileReference section */
|
|
30
|
-
|
|
31
|
-
/* Begin PBXFrameworksBuildPhase section */
|
|
32
|
-
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
33
|
-
isa = PBXFrameworksBuildPhase;
|
|
34
|
-
buildActionMask = 2147483647;
|
|
35
|
-
files = (
|
|
36
|
-
);
|
|
37
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
38
|
-
};
|
|
39
|
-
/* End PBXFrameworksBuildPhase section */
|
|
40
|
-
|
|
41
|
-
/* Begin PBXGroup section */
|
|
42
|
-
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
43
|
-
isa = PBXGroup;
|
|
44
|
-
children = (
|
|
45
|
-
134814201AA4EA6300B7C361 /* libClarity.a */,
|
|
46
|
-
);
|
|
47
|
-
name = Products;
|
|
48
|
-
sourceTree = "<group>";
|
|
49
|
-
};
|
|
50
|
-
58B511D21A9E6C8500147676 = {
|
|
51
|
-
isa = PBXGroup;
|
|
52
|
-
children = (
|
|
53
|
-
B3E7B5881CC2AC0600A0062D /* Clarity.h */,
|
|
54
|
-
B3E7B5891CC2AC0600A0062D /* Clarity.m */,
|
|
55
|
-
134814211AA4EA7D00B7C361 /* Products */,
|
|
56
|
-
);
|
|
57
|
-
sourceTree = "<group>";
|
|
58
|
-
};
|
|
59
|
-
/* End PBXGroup section */
|
|
60
|
-
|
|
61
|
-
/* Begin PBXNativeTarget section */
|
|
62
|
-
58B511DA1A9E6C8500147676 /* Clarity */ = {
|
|
63
|
-
isa = PBXNativeTarget;
|
|
64
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Clarity" */;
|
|
65
|
-
buildPhases = (
|
|
66
|
-
58B511D71A9E6C8500147676 /* Sources */,
|
|
67
|
-
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
68
|
-
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
69
|
-
);
|
|
70
|
-
buildRules = (
|
|
71
|
-
);
|
|
72
|
-
dependencies = (
|
|
73
|
-
);
|
|
74
|
-
name = Clarity;
|
|
75
|
-
productName = RCTDataManager;
|
|
76
|
-
productReference = 134814201AA4EA6300B7C361 /* libClarity.a */;
|
|
77
|
-
productType = "com.apple.product-type.library.static";
|
|
78
|
-
};
|
|
79
|
-
/* End PBXNativeTarget section */
|
|
80
|
-
|
|
81
|
-
/* Begin PBXProject section */
|
|
82
|
-
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
83
|
-
isa = PBXProject;
|
|
84
|
-
attributes = {
|
|
85
|
-
LastUpgradeCheck = 0920;
|
|
86
|
-
ORGANIZATIONNAME = Facebook;
|
|
87
|
-
TargetAttributes = {
|
|
88
|
-
58B511DA1A9E6C8500147676 = {
|
|
89
|
-
CreatedOnToolsVersion = 6.1.1;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Clarity" */;
|
|
94
|
-
compatibilityVersion = "Xcode 3.2";
|
|
95
|
-
developmentRegion = English;
|
|
96
|
-
hasScannedForEncodings = 0;
|
|
97
|
-
knownRegions = (
|
|
98
|
-
English,
|
|
99
|
-
en,
|
|
100
|
-
);
|
|
101
|
-
mainGroup = 58B511D21A9E6C8500147676;
|
|
102
|
-
productRefGroup = 58B511D21A9E6C8500147676;
|
|
103
|
-
projectDirPath = "";
|
|
104
|
-
projectRoot = "";
|
|
105
|
-
targets = (
|
|
106
|
-
58B511DA1A9E6C8500147676 /* Clarity */,
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
/* End PBXProject section */
|
|
110
|
-
|
|
111
|
-
/* Begin PBXSourcesBuildPhase section */
|
|
112
|
-
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
113
|
-
isa = PBXSourcesBuildPhase;
|
|
114
|
-
buildActionMask = 2147483647;
|
|
115
|
-
files = (
|
|
116
|
-
B3E7B58A1CC2AC0600A0062D /* Clarity.m in Sources */,
|
|
117
|
-
);
|
|
118
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
119
|
-
};
|
|
120
|
-
/* End PBXSourcesBuildPhase section */
|
|
121
|
-
|
|
122
|
-
/* Begin XCBuildConfiguration section */
|
|
123
|
-
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
124
|
-
isa = XCBuildConfiguration;
|
|
125
|
-
buildSettings = {
|
|
126
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
127
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
128
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
129
|
-
CLANG_ENABLE_MODULES = YES;
|
|
130
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
131
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
132
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
133
|
-
CLANG_WARN_COMMA = YES;
|
|
134
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
135
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
136
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
137
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
138
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
139
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
140
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
141
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
142
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
143
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
144
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
145
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
146
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
147
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
148
|
-
COPY_PHASE_STRIP = NO;
|
|
149
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
150
|
-
ENABLE_TESTABILITY = YES;
|
|
151
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
152
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
153
|
-
GCC_DYNAMIC_NO_PIC = NO;
|
|
154
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
155
|
-
GCC_OPTIMIZATION_LEVEL = 0;
|
|
156
|
-
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
157
|
-
"DEBUG=1",
|
|
158
|
-
"$(inherited)",
|
|
159
|
-
);
|
|
160
|
-
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
161
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
162
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
163
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
164
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
165
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
166
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
167
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
168
|
-
MTL_ENABLE_DEBUG_INFO = YES;
|
|
169
|
-
ONLY_ACTIVE_ARCH = YES;
|
|
170
|
-
SDKROOT = iphoneos;
|
|
171
|
-
};
|
|
172
|
-
name = Debug;
|
|
173
|
-
};
|
|
174
|
-
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
175
|
-
isa = XCBuildConfiguration;
|
|
176
|
-
buildSettings = {
|
|
177
|
-
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
178
|
-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
179
|
-
CLANG_CXX_LIBRARY = "libc++";
|
|
180
|
-
CLANG_ENABLE_MODULES = YES;
|
|
181
|
-
CLANG_ENABLE_OBJC_ARC = YES;
|
|
182
|
-
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
183
|
-
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
184
|
-
CLANG_WARN_COMMA = YES;
|
|
185
|
-
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
186
|
-
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
187
|
-
CLANG_WARN_EMPTY_BODY = YES;
|
|
188
|
-
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
189
|
-
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
190
|
-
CLANG_WARN_INT_CONVERSION = YES;
|
|
191
|
-
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
192
|
-
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
193
|
-
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
194
|
-
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
195
|
-
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
196
|
-
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
197
|
-
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
198
|
-
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
199
|
-
COPY_PHASE_STRIP = YES;
|
|
200
|
-
ENABLE_NS_ASSERTIONS = NO;
|
|
201
|
-
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
202
|
-
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
203
|
-
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
204
|
-
GCC_NO_COMMON_BLOCKS = YES;
|
|
205
|
-
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
206
|
-
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
207
|
-
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
208
|
-
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
209
|
-
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
210
|
-
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
211
|
-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
212
|
-
MTL_ENABLE_DEBUG_INFO = NO;
|
|
213
|
-
SDKROOT = iphoneos;
|
|
214
|
-
VALIDATE_PRODUCT = YES;
|
|
215
|
-
};
|
|
216
|
-
name = Release;
|
|
217
|
-
};
|
|
218
|
-
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
219
|
-
isa = XCBuildConfiguration;
|
|
220
|
-
buildSettings = {
|
|
221
|
-
HEADER_SEARCH_PATHS = (
|
|
222
|
-
"$(inherited)",
|
|
223
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
224
|
-
"$(SRCROOT)/../../../React/**",
|
|
225
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
226
|
-
);
|
|
227
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
228
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
229
|
-
PRODUCT_NAME = Clarity;
|
|
230
|
-
SKIP_INSTALL = YES;
|
|
231
|
-
};
|
|
232
|
-
name = Debug;
|
|
233
|
-
};
|
|
234
|
-
58B511F11A9E6C8500147676 /* Release */ = {
|
|
235
|
-
isa = XCBuildConfiguration;
|
|
236
|
-
buildSettings = {
|
|
237
|
-
HEADER_SEARCH_PATHS = (
|
|
238
|
-
"$(inherited)",
|
|
239
|
-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
240
|
-
"$(SRCROOT)/../../../React/**",
|
|
241
|
-
"$(SRCROOT)/../../react-native/React/**",
|
|
242
|
-
);
|
|
243
|
-
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
244
|
-
OTHER_LDFLAGS = "-ObjC";
|
|
245
|
-
PRODUCT_NAME = Clarity;
|
|
246
|
-
SKIP_INSTALL = YES;
|
|
247
|
-
};
|
|
248
|
-
name = Release;
|
|
249
|
-
};
|
|
250
|
-
/* End XCBuildConfiguration section */
|
|
251
|
-
|
|
252
|
-
/* Begin XCConfigurationList section */
|
|
253
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Clarity" */ = {
|
|
254
|
-
isa = XCConfigurationList;
|
|
255
|
-
buildConfigurations = (
|
|
256
|
-
58B511ED1A9E6C8500147676 /* Debug */,
|
|
257
|
-
58B511EE1A9E6C8500147676 /* Release */,
|
|
258
|
-
);
|
|
259
|
-
defaultConfigurationIsVisible = 0;
|
|
260
|
-
defaultConfigurationName = Release;
|
|
261
|
-
};
|
|
262
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Clarity" */ = {
|
|
263
|
-
isa = XCConfigurationList;
|
|
264
|
-
buildConfigurations = (
|
|
265
|
-
58B511F01A9E6C8500147676 /* Debug */,
|
|
266
|
-
58B511F11A9E6C8500147676 /* Release */,
|
|
267
|
-
);
|
|
268
|
-
defaultConfigurationIsVisible = 0;
|
|
269
|
-
defaultConfigurationName = Release;
|
|
270
|
-
};
|
|
271
|
-
/* End XCConfigurationList section */
|
|
272
|
-
};
|
|
273
|
-
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
274
|
-
}
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
5E555C0D2413F4C50049A1A2 /* Clarity.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* Clarity.m */; };
|
|
11
|
+
/* End PBXBuildFile section */
|
|
12
|
+
|
|
13
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
14
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
15
|
+
isa = PBXCopyFilesBuildPhase;
|
|
16
|
+
buildActionMask = 2147483647;
|
|
17
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
18
|
+
dstSubfolderSpec = 16;
|
|
19
|
+
files = (
|
|
20
|
+
);
|
|
21
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
22
|
+
};
|
|
23
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
24
|
+
|
|
25
|
+
/* Begin PBXFileReference section */
|
|
26
|
+
134814201AA4EA6300B7C361 /* libClarity.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libClarity.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
27
|
+
B3E7B5881CC2AC0600A0062D /* Clarity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clarity.h; sourceTree = "<group>"; };
|
|
28
|
+
B3E7B5891CC2AC0600A0062D /* Clarity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Clarity.m; sourceTree = "<group>"; };
|
|
29
|
+
/* End PBXFileReference section */
|
|
30
|
+
|
|
31
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
32
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
33
|
+
isa = PBXFrameworksBuildPhase;
|
|
34
|
+
buildActionMask = 2147483647;
|
|
35
|
+
files = (
|
|
36
|
+
);
|
|
37
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
38
|
+
};
|
|
39
|
+
/* End PBXFrameworksBuildPhase section */
|
|
40
|
+
|
|
41
|
+
/* Begin PBXGroup section */
|
|
42
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
43
|
+
isa = PBXGroup;
|
|
44
|
+
children = (
|
|
45
|
+
134814201AA4EA6300B7C361 /* libClarity.a */,
|
|
46
|
+
);
|
|
47
|
+
name = Products;
|
|
48
|
+
sourceTree = "<group>";
|
|
49
|
+
};
|
|
50
|
+
58B511D21A9E6C8500147676 = {
|
|
51
|
+
isa = PBXGroup;
|
|
52
|
+
children = (
|
|
53
|
+
B3E7B5881CC2AC0600A0062D /* Clarity.h */,
|
|
54
|
+
B3E7B5891CC2AC0600A0062D /* Clarity.m */,
|
|
55
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
56
|
+
);
|
|
57
|
+
sourceTree = "<group>";
|
|
58
|
+
};
|
|
59
|
+
/* End PBXGroup section */
|
|
60
|
+
|
|
61
|
+
/* Begin PBXNativeTarget section */
|
|
62
|
+
58B511DA1A9E6C8500147676 /* Clarity */ = {
|
|
63
|
+
isa = PBXNativeTarget;
|
|
64
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Clarity" */;
|
|
65
|
+
buildPhases = (
|
|
66
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
67
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
68
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
69
|
+
);
|
|
70
|
+
buildRules = (
|
|
71
|
+
);
|
|
72
|
+
dependencies = (
|
|
73
|
+
);
|
|
74
|
+
name = Clarity;
|
|
75
|
+
productName = RCTDataManager;
|
|
76
|
+
productReference = 134814201AA4EA6300B7C361 /* libClarity.a */;
|
|
77
|
+
productType = "com.apple.product-type.library.static";
|
|
78
|
+
};
|
|
79
|
+
/* End PBXNativeTarget section */
|
|
80
|
+
|
|
81
|
+
/* Begin PBXProject section */
|
|
82
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
83
|
+
isa = PBXProject;
|
|
84
|
+
attributes = {
|
|
85
|
+
LastUpgradeCheck = 0920;
|
|
86
|
+
ORGANIZATIONNAME = Facebook;
|
|
87
|
+
TargetAttributes = {
|
|
88
|
+
58B511DA1A9E6C8500147676 = {
|
|
89
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Clarity" */;
|
|
94
|
+
compatibilityVersion = "Xcode 3.2";
|
|
95
|
+
developmentRegion = English;
|
|
96
|
+
hasScannedForEncodings = 0;
|
|
97
|
+
knownRegions = (
|
|
98
|
+
English,
|
|
99
|
+
en,
|
|
100
|
+
);
|
|
101
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
102
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
103
|
+
projectDirPath = "";
|
|
104
|
+
projectRoot = "";
|
|
105
|
+
targets = (
|
|
106
|
+
58B511DA1A9E6C8500147676 /* Clarity */,
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
/* End PBXProject section */
|
|
110
|
+
|
|
111
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
112
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
113
|
+
isa = PBXSourcesBuildPhase;
|
|
114
|
+
buildActionMask = 2147483647;
|
|
115
|
+
files = (
|
|
116
|
+
B3E7B58A1CC2AC0600A0062D /* Clarity.m in Sources */,
|
|
117
|
+
);
|
|
118
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
119
|
+
};
|
|
120
|
+
/* End PBXSourcesBuildPhase section */
|
|
121
|
+
|
|
122
|
+
/* Begin XCBuildConfiguration section */
|
|
123
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
124
|
+
isa = XCBuildConfiguration;
|
|
125
|
+
buildSettings = {
|
|
126
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
127
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
128
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
129
|
+
CLANG_ENABLE_MODULES = YES;
|
|
130
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
131
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
132
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
133
|
+
CLANG_WARN_COMMA = YES;
|
|
134
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
135
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
136
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
137
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
138
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
139
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
140
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
141
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
142
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
143
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
144
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
145
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
146
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
147
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
148
|
+
COPY_PHASE_STRIP = NO;
|
|
149
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
150
|
+
ENABLE_TESTABILITY = YES;
|
|
151
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
152
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
153
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
154
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
155
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
156
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
157
|
+
"DEBUG=1",
|
|
158
|
+
"$(inherited)",
|
|
159
|
+
);
|
|
160
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
161
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
162
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
163
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
164
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
165
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
166
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
167
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
168
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
169
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
170
|
+
SDKROOT = iphoneos;
|
|
171
|
+
};
|
|
172
|
+
name = Debug;
|
|
173
|
+
};
|
|
174
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
175
|
+
isa = XCBuildConfiguration;
|
|
176
|
+
buildSettings = {
|
|
177
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
178
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
179
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
180
|
+
CLANG_ENABLE_MODULES = YES;
|
|
181
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
182
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
183
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
184
|
+
CLANG_WARN_COMMA = YES;
|
|
185
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
186
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
187
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
188
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
189
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
190
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
191
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
192
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
193
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
194
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
195
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
196
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
197
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
198
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
199
|
+
COPY_PHASE_STRIP = YES;
|
|
200
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
201
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
202
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
203
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
204
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
205
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
206
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
207
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
208
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
209
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
210
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
211
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
212
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
213
|
+
SDKROOT = iphoneos;
|
|
214
|
+
VALIDATE_PRODUCT = YES;
|
|
215
|
+
};
|
|
216
|
+
name = Release;
|
|
217
|
+
};
|
|
218
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
219
|
+
isa = XCBuildConfiguration;
|
|
220
|
+
buildSettings = {
|
|
221
|
+
HEADER_SEARCH_PATHS = (
|
|
222
|
+
"$(inherited)",
|
|
223
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
224
|
+
"$(SRCROOT)/../../../React/**",
|
|
225
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
226
|
+
);
|
|
227
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
228
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
229
|
+
PRODUCT_NAME = Clarity;
|
|
230
|
+
SKIP_INSTALL = YES;
|
|
231
|
+
};
|
|
232
|
+
name = Debug;
|
|
233
|
+
};
|
|
234
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
235
|
+
isa = XCBuildConfiguration;
|
|
236
|
+
buildSettings = {
|
|
237
|
+
HEADER_SEARCH_PATHS = (
|
|
238
|
+
"$(inherited)",
|
|
239
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
240
|
+
"$(SRCROOT)/../../../React/**",
|
|
241
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
242
|
+
);
|
|
243
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
244
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
245
|
+
PRODUCT_NAME = Clarity;
|
|
246
|
+
SKIP_INSTALL = YES;
|
|
247
|
+
};
|
|
248
|
+
name = Release;
|
|
249
|
+
};
|
|
250
|
+
/* End XCBuildConfiguration section */
|
|
251
|
+
|
|
252
|
+
/* Begin XCConfigurationList section */
|
|
253
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Clarity" */ = {
|
|
254
|
+
isa = XCConfigurationList;
|
|
255
|
+
buildConfigurations = (
|
|
256
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
257
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
258
|
+
);
|
|
259
|
+
defaultConfigurationIsVisible = 0;
|
|
260
|
+
defaultConfigurationName = Release;
|
|
261
|
+
};
|
|
262
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Clarity" */ = {
|
|
263
|
+
isa = XCConfigurationList;
|
|
264
|
+
buildConfigurations = (
|
|
265
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
266
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
267
|
+
);
|
|
268
|
+
defaultConfigurationIsVisible = 0;
|
|
269
|
+
defaultConfigurationName = Release;
|
|
270
|
+
};
|
|
271
|
+
/* End XCConfigurationList section */
|
|
272
|
+
};
|
|
273
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
274
|
+
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getCurrentSessionId = getCurrentSessionId;
|
|
7
7
|
exports.initialize = initialize;
|
|
8
|
+
exports.setCurrentScreenName = setCurrentScreenName;
|
|
8
9
|
exports.setCustomUserId = setCustomUserId;
|
|
9
10
|
var _reactNative = require("react-native");
|
|
10
11
|
const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be linked. Make sure: \n\n` +
|
|
11
12
|
// Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + TODO: add back when iOS is supported.
|
|
12
13
|
'- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
13
14
|
const Clarity = _reactNative.NativeModules.Clarity;
|
|
15
|
+
const SupportedPlatforms = ['android'];
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Initializes the Clarity plugin with the provided parameters.
|
|
@@ -32,8 +34,8 @@ function initialize(projectId, userId) {
|
|
|
32
34
|
let allowMeteredNetworkUsage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
33
35
|
let enableWebViewCapture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
34
36
|
let allowedDomains = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ["*"];
|
|
35
|
-
if (_reactNative.Platform.OS
|
|
36
|
-
console.warn("Clarity supports
|
|
37
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
38
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
if (Clarity === null) {
|
|
@@ -54,8 +56,8 @@ function initialize(projectId, userId) {
|
|
|
54
56
|
* @param customUserId The custom user id to set.
|
|
55
57
|
*/
|
|
56
58
|
function setCustomUserId(customUserId) {
|
|
57
|
-
if (_reactNative.Platform.OS
|
|
58
|
-
console.warn("Clarity supports
|
|
59
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
60
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
if (Clarity === null) {
|
|
@@ -71,8 +73,8 @@ function setCustomUserId(customUserId) {
|
|
|
71
73
|
* @returns a promise that resolves to the current session id.
|
|
72
74
|
*/
|
|
73
75
|
function getCurrentSessionId() {
|
|
74
|
-
if (_reactNative.Platform.OS
|
|
75
|
-
console.warn("Clarity supports
|
|
76
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
77
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
76
78
|
return new Promise(resolve => {
|
|
77
79
|
resolve("Undefined");
|
|
78
80
|
});
|
|
@@ -85,4 +87,15 @@ function getCurrentSessionId() {
|
|
|
85
87
|
}
|
|
86
88
|
return Clarity.getCurrentSessionId();
|
|
87
89
|
}
|
|
90
|
+
function setCurrentScreenName(screenName) {
|
|
91
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
92
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (Clarity === null) {
|
|
96
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
Clarity.setCurrentScreenName(screenName);
|
|
100
|
+
}
|
|
88
101
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Clarity","NativeModules","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","Platform","OS","console","warn","error","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Clarity","NativeModules","SupportedPlatforms","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","includes","Platform","OS","console","warn","join","error","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve","setCurrentScreenName","screenName"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"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"}
|
package/lib/module/index.js
CHANGED
|
@@ -3,6 +3,7 @@ const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be lin
|
|
|
3
3
|
// Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + TODO: add back when iOS is supported.
|
|
4
4
|
'- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
5
5
|
const Clarity = NativeModules.Clarity;
|
|
6
|
+
const SupportedPlatforms = ['android'];
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Initializes the Clarity plugin with the provided parameters.
|
|
@@ -24,8 +25,8 @@ export function initialize(projectId, userId) {
|
|
|
24
25
|
let allowMeteredNetworkUsage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
25
26
|
let enableWebViewCapture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
26
27
|
let allowedDomains = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ["*"];
|
|
27
|
-
if (Platform.OS
|
|
28
|
-
console.warn("Clarity supports
|
|
28
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
29
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
if (Clarity === null) {
|
|
@@ -46,8 +47,8 @@ export function initialize(projectId, userId) {
|
|
|
46
47
|
* @param customUserId The custom user id to set.
|
|
47
48
|
*/
|
|
48
49
|
export function setCustomUserId(customUserId) {
|
|
49
|
-
if (Platform.OS
|
|
50
|
-
console.warn("Clarity supports
|
|
50
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
51
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
if (Clarity === null) {
|
|
@@ -63,8 +64,8 @@ export function setCustomUserId(customUserId) {
|
|
|
63
64
|
* @returns a promise that resolves to the current session id.
|
|
64
65
|
*/
|
|
65
66
|
export function getCurrentSessionId() {
|
|
66
|
-
if (Platform.OS
|
|
67
|
-
console.warn("Clarity supports
|
|
67
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
68
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
68
69
|
return new Promise(resolve => {
|
|
69
70
|
resolve("Undefined");
|
|
70
71
|
});
|
|
@@ -77,4 +78,15 @@ export function getCurrentSessionId() {
|
|
|
77
78
|
}
|
|
78
79
|
return Clarity.getCurrentSessionId();
|
|
79
80
|
}
|
|
81
|
+
export function setCurrentScreenName(screenName) {
|
|
82
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
83
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (Clarity === null) {
|
|
87
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
Clarity.setCurrentScreenName(screenName);
|
|
91
|
+
}
|
|
80
92
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","Clarity","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","OS","console","warn","error","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,+EAA8E;AAC/E;AACA,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGH,aAAa,CAACG,OAAO;;
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","Clarity","SupportedPlatforms","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","includes","OS","console","warn","join","error","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve","setCurrentScreenName","screenName"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"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"}
|
|
@@ -31,4 +31,5 @@ export declare function setCustomUserId(customUserId: string): void;
|
|
|
31
31
|
* @returns a promise that resolves to the current session id.
|
|
32
32
|
*/
|
|
33
33
|
export declare function getCurrentSessionId(): Promise<string>;
|
|
34
|
+
export declare function setCurrentScreenName(screenName: string): void;
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,GAAE,MAAe,EACzB,wBAAwB,GAAE,OAAe,EACzC,oBAAoB,GAAE,OAAc,EACpC,cAAc,GAAE,MAAM,EAAU,QAYjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,QAYnD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAgBrD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,QAYtD"}
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
-
|
|
6
|
-
Pod::Spec.new do |s|
|
|
7
|
-
s.name = "react-native-clarity"
|
|
8
|
-
s.version = package["version"]
|
|
9
|
-
s.summary = package["description"]
|
|
10
|
-
s.homepage = package["homepage"]
|
|
11
|
-
s.license = package["license"]
|
|
12
|
-
s.authors = package["author"]
|
|
13
|
-
|
|
14
|
-
s.platforms = { :ios => "11.0" }
|
|
15
|
-
s.source = { :git => "https://msasg.visualstudio.com/Clarity/_git/clarity-react-native.git", :tag => "#{s.version}" }
|
|
16
|
-
|
|
17
|
-
s.source_files = "ios/**/*.{h,m,mm}"
|
|
18
|
-
|
|
19
|
-
s.dependency "React-Core"
|
|
20
|
-
|
|
21
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
22
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
23
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
24
|
-
s.pod_target_xcconfig = {
|
|
25
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
26
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
27
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
28
|
-
}
|
|
29
|
-
s.dependency "React-Codegen"
|
|
30
|
-
s.dependency "RCT-Folly"
|
|
31
|
-
s.dependency "RCTRequired"
|
|
32
|
-
s.dependency "RCTTypeSafety"
|
|
33
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
34
|
-
end
|
|
35
|
-
end
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "react-native-clarity"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => "11.0" }
|
|
15
|
+
s.source = { :git => "https://msasg.visualstudio.com/Clarity/_git/clarity-react-native.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm}"
|
|
18
|
+
|
|
19
|
+
s.dependency "React-Core"
|
|
20
|
+
|
|
21
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
22
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
23
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
24
|
+
s.pod_target_xcconfig = {
|
|
25
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
26
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
27
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
28
|
+
}
|
|
29
|
+
s.dependency "React-Codegen"
|
|
30
|
+
s.dependency "RCT-Folly"
|
|
31
|
+
s.dependency "RCTRequired"
|
|
32
|
+
s.dependency "RCTTypeSafety"
|
|
33
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
34
|
+
end
|
|
35
|
+
end
|
package/src/index.tsx
CHANGED
|
@@ -8,6 +8,8 @@ const LINKING_ERROR =
|
|
|
8
8
|
|
|
9
9
|
const Clarity = NativeModules.Clarity;
|
|
10
10
|
|
|
11
|
+
const SupportedPlatforms = ['android']
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* Initializes the Clarity plugin with the provided parameters.
|
|
13
15
|
*
|
|
@@ -30,8 +32,8 @@ export function initialize(
|
|
|
30
32
|
allowMeteredNetworkUsage: boolean = false,
|
|
31
33
|
enableWebViewCapture: boolean = true,
|
|
32
34
|
allowedDomains: string[] = ["*"]) {
|
|
33
|
-
if (Platform.OS
|
|
34
|
-
console.warn("Clarity supports
|
|
35
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
36
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -54,8 +56,8 @@ export function initialize(
|
|
|
54
56
|
* @param customUserId The custom user id to set.
|
|
55
57
|
*/
|
|
56
58
|
export function setCustomUserId(customUserId: string) {
|
|
57
|
-
if (Platform.OS
|
|
58
|
-
console.warn("Clarity supports
|
|
59
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
60
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -73,8 +75,8 @@ export function setCustomUserId(customUserId: string) {
|
|
|
73
75
|
* @returns a promise that resolves to the current session id.
|
|
74
76
|
*/
|
|
75
77
|
export function getCurrentSessionId(): Promise<string> {
|
|
76
|
-
if (Platform.OS
|
|
77
|
-
console.warn("Clarity supports
|
|
78
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
79
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
78
80
|
return new Promise((resolve) => {
|
|
79
81
|
resolve("Undefined");
|
|
80
82
|
});
|
|
@@ -89,3 +91,17 @@ export function getCurrentSessionId(): Promise<string> {
|
|
|
89
91
|
|
|
90
92
|
return Clarity.getCurrentSessionId();
|
|
91
93
|
}
|
|
94
|
+
|
|
95
|
+
export function setCurrentScreenName(screenName: string) {
|
|
96
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
97
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (Clarity === null) {
|
|
102
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Clarity.setCurrentScreenName(screenName);
|
|
107
|
+
}
|