@snowplow/react-native-tracker 1.4.0 → 2.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/.editorconfig +15 -0
- package/.eslintignore +6 -0
- package/.gitattributes +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/actions/setup/action.yml +28 -0
- package/.github/workflows/build.yml +150 -0
- package/.github/workflows/deploy.yml +98 -0
- package/.github/workflows/e2e-android.yml +121 -0
- package/.github/workflows/e2e-ios.yml +90 -0
- package/.github/workflows/snyk.yml +21 -0
- package/.gitignore +70 -0
- package/.npmignore +60 -0
- package/.nvmrc +1 -0
- package/.watchmanconfig +1 -0
- package/.yarnrc +3 -0
- package/CHANGELOG +166 -0
- package/CONTRIBUTING.md +80 -0
- package/README.md +23 -110
- package/android/build.gradle +93 -37
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
- package/android/gradle.properties +5 -2
- package/android/gradlew +172 -110
- package/android/gradlew.bat +24 -19
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +704 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +17 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +271 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +213 -0
- package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +5 -0
- package/babel.config.js +3 -0
- package/example/.watchmanconfig +1 -0
- package/example/Gemfile +6 -0
- package/example/android/app/build.gradle +129 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +36 -0
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +21 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +75 -0
- package/example/android/app/src/main/AndroidManifest.xml +26 -0
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +32 -0
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +62 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +20 -0
- package/example/android/build.gradle +31 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/example/android/gradle.properties +44 -0
- package/example/android/gradlew +244 -0
- package/example/android/gradlew.bat +92 -0
- package/example/android/settings.gradle +4 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +17 -0
- package/example/detox.config.js +92 -0
- package/example/e2e/config.json +10 -0
- package/example/e2e/emitEvents.e2e.detox.js +108 -0
- package/example/e2e/environment.js +23 -0
- package/example/e2e/helpers/microCommands.js +153 -0
- package/example/e2e/helpers/microHelpers.js +346 -0
- package/example/e2e/helpers/microHelpers.test.js +308 -0
- package/example/e2e/helpers/schemas.js +62 -0
- package/example/e2e/jest.config.js +16 -0
- package/example/e2e/setup.js +4 -0
- package/example/e2e/testEvents.micro.test.js +300 -0
- package/example/index.js +5 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/Podfile +64 -0
- package/example/ios/Podfile.lock +737 -0
- package/example/ios/ReactNativeTrackerExample/AppDelegate.h +6 -0
- package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +26 -0
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/ReactNativeTrackerExample/Info.plist +55 -0
- package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +47 -0
- package/example/ios/ReactNativeTrackerExample/main.m +10 -0
- package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +3 -0
- package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +722 -0
- package/{ios/RNSnowplowTracker.xcodeproj/xcshareddata/xcschemes/RNSnowplowTracker.xcscheme → example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme} +29 -21
- package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/ReactNativeTrackerExampleTests/Info.plist +24 -0
- package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +66 -0
- package/example/metro.config.js +45 -0
- package/example/package.json +54 -0
- package/example/react-native.config.js +10 -0
- package/example/src/App.js +557 -0
- package/example/tsconfig.json +5 -0
- package/example/yarn.lock +7379 -0
- package/ios/ReactNativeTracker-Bridging-Header.h +2 -0
- package/ios/ReactNativeTracker.mm +165 -0
- package/ios/ReactNativeTracker.swift +757 -0
- package/ios/{RNSnowplowTracker.xcodeproj → ReactNativeTracker.xcodeproj}/project.pbxproj +55 -79
- package/ios/Util/ConfigUtils.swift +206 -0
- package/ios/Util/TrackerVersion.swift +3 -0
- package/ios/Util/Utilities.swift +37 -0
- package/lefthook.yml +11 -0
- package/lib/commonjs/api.js +475 -0
- package/lib/commonjs/api.js.map +1 -0
- package/lib/commonjs/configurations.js +209 -0
- package/lib/commonjs/configurations.js.map +1 -0
- package/lib/commonjs/constants.js +85 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/events.js +256 -0
- package/lib/commonjs/events.js.map +1 -0
- package/lib/commonjs/index.js +141 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/jsCore.js +393 -0
- package/lib/commonjs/jsCore.js.map +1 -0
- package/lib/commonjs/native.js +29 -0
- package/lib/commonjs/native.js.map +1 -0
- package/lib/commonjs/subject.js +248 -0
- package/lib/commonjs/subject.js.map +1 -0
- package/lib/commonjs/tracker.js +221 -0
- package/lib/commonjs/tracker.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils.js +85 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/webViewInterface.js +79 -0
- package/lib/commonjs/webViewInterface.js.map +1 -0
- package/lib/module/api.js +439 -0
- package/lib/module/api.js.map +1 -0
- package/lib/module/configurations.js +197 -0
- package/lib/module/configurations.js.map +1 -0
- package/lib/module/constants.js +80 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/events.js +240 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +129 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/jsCore.js +390 -0
- package/lib/module/jsCore.js.map +1 -0
- package/lib/module/native.js +25 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/subject.js +235 -0
- package/lib/module/subject.js.map +1 -0
- package/lib/module/tracker.js +209 -0
- package/lib/module/tracker.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +79 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/webViewInterface.js +75 -0
- package/lib/module/webViewInterface.js.map +1 -0
- package/lib/typescript/__tests__/api.test.d.ts +2 -0
- package/lib/typescript/__tests__/api.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/configurations.test.d.ts +2 -0
- package/lib/typescript/__tests__/configurations.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/events.test.d.ts +2 -0
- package/lib/typescript/__tests__/events.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/index.test.d.ts +2 -0
- package/lib/typescript/__tests__/index.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/jsCore.test.d.ts +2 -0
- package/lib/typescript/__tests__/jsCore.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/utils.test.d.ts +2 -0
- package/lib/typescript/__tests__/utils.test.d.ts.map +1 -0
- package/lib/typescript/api.d.ts +226 -0
- package/lib/typescript/api.d.ts.map +1 -0
- package/lib/typescript/configurations.d.ts +73 -0
- package/lib/typescript/configurations.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +59 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/events.d.ts +101 -0
- package/lib/typescript/events.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +27 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/jsCore.d.ts +140 -0
- package/lib/typescript/jsCore.d.ts.map +1 -0
- package/lib/typescript/native.d.ts +4 -0
- package/lib/typescript/native.d.ts.map +1 -0
- package/lib/typescript/subject.d.ts +91 -0
- package/lib/typescript/subject.d.ts.map +1 -0
- package/lib/typescript/tracker.d.ts +93 -0
- package/lib/typescript/tracker.d.ts.map +1 -0
- package/{dist/index.d.ts → lib/typescript/types.d.ts} +188 -75
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +35 -0
- package/lib/typescript/utils.d.ts.map +1 -0
- package/lib/typescript/webViewInterface.d.ts +15 -0
- package/lib/typescript/webViewInterface.d.ts.map +1 -0
- package/package.json +134 -52
- package/scripts/bootstrap.js +29 -0
- package/snowplow-react-native-tracker.podspec +42 -0
- package/src/__mocks__/react-native.js +7 -0
- package/src/__tests__/api.test.ts +34 -0
- package/src/__tests__/configurations.test.ts +620 -0
- package/src/__tests__/events.test.ts +749 -0
- package/src/__tests__/index.test.ts +27 -0
- package/src/__tests__/jsCore.test.ts +169 -0
- package/src/__tests__/utils.test.ts +23 -0
- package/src/api.ts +535 -0
- package/src/configurations.ts +337 -0
- package/src/constants.ts +102 -0
- package/src/events.ts +330 -0
- package/src/index.ts +189 -0
- package/src/jsCore.ts +553 -0
- package/src/native.ts +34 -0
- package/src/subject.ts +315 -0
- package/src/tracker.ts +330 -0
- package/src/types.ts +1087 -0
- package/src/utils.ts +78 -0
- package/src/webViewInterface.ts +105 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +28 -0
- package/turbo.json +34 -0
- package/yarn.lock +9333 -0
- package/RNSnowplowTracker.podspec +0 -24
- package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerModule.java +0 -750
- package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerPackage.java +0 -29
- package/android/src/main/java/com/snowplowanalytics/react/util/ConfigUtil.java +0 -351
- package/android/src/main/java/com/snowplowanalytics/react/util/EventUtil.java +0 -339
- package/android/src/main/java/com/snowplowanalytics/react/util/TrackerVersion.java +0 -7
- package/dist/index.js +0 -2026
- package/dist/index.js.map +0 -1
- package/ios/RNSnowplowTracker.h +0 -34
- package/ios/RNSnowplowTracker.m +0 -911
- package/ios/Util/NSDictionary+RNSP_TypeMethods.h +0 -33
- package/ios/Util/NSDictionary+RNSP_TypeMethods.m +0 -40
- package/ios/Util/RNConfigUtils.h +0 -44
- package/ios/Util/RNConfigUtils.m +0 -209
- package/ios/Util/RNTrackerVersion.h +0 -27
- package/ios/Util/RNTrackerVersion.m +0 -27
- package/ios/Util/RNUtilities.h +0 -32
- package/ios/Util/RNUtilities.m +0 -68
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
6BE719792AA0B6F7003E0F20 /* ConfigUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BE719782AA0B6F7003E0F20 /* ConfigUtils.swift */; };
|
|
11
|
+
6BE7197B2AA0B70E003E0F20 /* TrackerVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BE7197A2AA0B70E003E0F20 /* TrackerVersion.swift */; };
|
|
12
|
+
6BE7197D2AA0B732003E0F20 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BE7197C2AA0B732003E0F20 /* Utilities.swift */; };
|
|
13
|
+
F4FF95D7245B92E800C19C63 /* ReactNativeTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* ReactNativeTracker.swift */; };
|
|
13
14
|
/* End PBXBuildFile section */
|
|
14
15
|
|
|
15
16
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
@@ -25,12 +26,13 @@
|
|
|
25
26
|
/* End PBXCopyFilesBuildPhase section */
|
|
26
27
|
|
|
27
28
|
/* Begin PBXFileReference section */
|
|
28
|
-
134814201AA4EA6300B7C361 /*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
134814201AA4EA6300B7C361 /* libReactNativeTracker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeTracker.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
30
|
+
6BE719782AA0B6F7003E0F20 /* ConfigUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigUtils.swift; sourceTree = "<group>"; };
|
|
31
|
+
6BE7197A2AA0B70E003E0F20 /* TrackerVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackerVersion.swift; sourceTree = "<group>"; };
|
|
32
|
+
6BE7197C2AA0B732003E0F20 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
|
|
33
|
+
B3E7B5891CC2AC0600A0062D /* ReactNativeTracker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeTracker.mm; sourceTree = "<group>"; };
|
|
34
|
+
F4FF95D5245B92E700C19C63 /* ReactNativeTracker-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ReactNativeTracker-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
35
|
+
F4FF95D6245B92E800C19C63 /* ReactNativeTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactNativeTracker.swift; sourceTree = "<group>"; };
|
|
34
36
|
/* End PBXFileReference section */
|
|
35
37
|
|
|
36
38
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -38,7 +40,6 @@
|
|
|
38
40
|
isa = PBXFrameworksBuildPhase;
|
|
39
41
|
buildActionMask = 2147483647;
|
|
40
42
|
files = (
|
|
41
|
-
0562F54E146600A44BDEF45D /* libPods-RNSnowplowTracker.a in Frameworks */,
|
|
42
43
|
);
|
|
43
44
|
runOnlyForDeploymentPostprocessing = 0;
|
|
44
45
|
};
|
|
@@ -48,59 +49,39 @@
|
|
|
48
49
|
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
49
50
|
isa = PBXGroup;
|
|
50
51
|
children = (
|
|
51
|
-
134814201AA4EA6300B7C361 /*
|
|
52
|
+
134814201AA4EA6300B7C361 /* libReactNativeTracker.a */,
|
|
52
53
|
);
|
|
53
54
|
name = Products;
|
|
54
55
|
sourceTree = "<group>";
|
|
55
56
|
};
|
|
56
|
-
47AD2C542223E36A7CFE72AE /* Frameworks */ = {
|
|
57
|
-
isa = PBXGroup;
|
|
58
|
-
children = (
|
|
59
|
-
8E15379B78A468FF69B0BDCA /* libPods-RNSnowplowTracker.a */,
|
|
60
|
-
);
|
|
61
|
-
name = Frameworks;
|
|
62
|
-
sourceTree = "<group>";
|
|
63
|
-
};
|
|
64
57
|
58B511D21A9E6C8500147676 = {
|
|
65
58
|
isa = PBXGroup;
|
|
66
59
|
children = (
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
6BE719772AA0B6DB003E0F20 /* Util */,
|
|
61
|
+
F4FF95D6245B92E800C19C63 /* ReactNativeTracker.swift */,
|
|
62
|
+
B3E7B5891CC2AC0600A0062D /* ReactNativeTracker.mm */,
|
|
63
|
+
F4FF95D5245B92E700C19C63 /* ReactNativeTracker-Bridging-Header.h */,
|
|
69
64
|
134814211AA4EA7D00B7C361 /* Products */,
|
|
70
|
-
7FFB9F310E25AB7A09247AE0 /* Pods */,
|
|
71
|
-
47AD2C542223E36A7CFE72AE /* Frameworks */,
|
|
72
65
|
);
|
|
73
66
|
sourceTree = "<group>";
|
|
74
67
|
};
|
|
75
|
-
|
|
68
|
+
6BE719772AA0B6DB003E0F20 /* Util */ = {
|
|
76
69
|
isa = PBXGroup;
|
|
77
70
|
children = (
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
6BE719782AA0B6F7003E0F20 /* ConfigUtils.swift */,
|
|
72
|
+
6BE7197A2AA0B70E003E0F20 /* TrackerVersion.swift */,
|
|
73
|
+
6BE7197C2AA0B732003E0F20 /* Utilities.swift */,
|
|
80
74
|
);
|
|
81
|
-
path =
|
|
75
|
+
path = Util;
|
|
82
76
|
sourceTree = "<group>";
|
|
83
77
|
};
|
|
84
78
|
/* End PBXGroup section */
|
|
85
79
|
|
|
86
|
-
/* Begin PBXHeadersBuildPhase section */
|
|
87
|
-
75D5EB7D2293B1F8005C8629 /* Headers */ = {
|
|
88
|
-
isa = PBXHeadersBuildPhase;
|
|
89
|
-
buildActionMask = 2147483647;
|
|
90
|
-
files = (
|
|
91
|
-
75D5EB7F2293B206005C8629 /* RNSnowplowTracker.h in Headers */,
|
|
92
|
-
);
|
|
93
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
94
|
-
};
|
|
95
|
-
/* End PBXHeadersBuildPhase section */
|
|
96
|
-
|
|
97
80
|
/* Begin PBXNativeTarget section */
|
|
98
|
-
58B511DA1A9E6C8500147676 /*
|
|
81
|
+
58B511DA1A9E6C8500147676 /* ReactNativeTracker */ = {
|
|
99
82
|
isa = PBXNativeTarget;
|
|
100
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "
|
|
83
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ReactNativeTracker" */;
|
|
101
84
|
buildPhases = (
|
|
102
|
-
4CCD70066BBE9C051429F7AF /* [CP] Check Pods Manifest.lock */,
|
|
103
|
-
75D5EB7D2293B1F8005C8629 /* Headers */,
|
|
104
85
|
58B511D71A9E6C8500147676 /* Sources */,
|
|
105
86
|
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
106
87
|
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
@@ -109,9 +90,9 @@
|
|
|
109
90
|
);
|
|
110
91
|
dependencies = (
|
|
111
92
|
);
|
|
112
|
-
name =
|
|
93
|
+
name = ReactNativeTracker;
|
|
113
94
|
productName = RCTDataManager;
|
|
114
|
-
productReference = 134814201AA4EA6300B7C361 /*
|
|
95
|
+
productReference = 134814201AA4EA6300B7C361 /* libReactNativeTracker.a */;
|
|
115
96
|
productType = "com.apple.product-type.library.static";
|
|
116
97
|
};
|
|
117
98
|
/* End PBXNativeTarget section */
|
|
@@ -120,7 +101,7 @@
|
|
|
120
101
|
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
121
102
|
isa = PBXProject;
|
|
122
103
|
attributes = {
|
|
123
|
-
LastUpgradeCheck =
|
|
104
|
+
LastUpgradeCheck = 0920;
|
|
124
105
|
ORGANIZATIONNAME = Facebook;
|
|
125
106
|
TargetAttributes = {
|
|
126
107
|
58B511DA1A9E6C8500147676 = {
|
|
@@ -128,7 +109,7 @@
|
|
|
128
109
|
};
|
|
129
110
|
};
|
|
130
111
|
};
|
|
131
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "
|
|
112
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ReactNativeTracker" */;
|
|
132
113
|
compatibilityVersion = "Xcode 3.2";
|
|
133
114
|
developmentRegion = English;
|
|
134
115
|
hasScannedForEncodings = 0;
|
|
@@ -141,42 +122,20 @@
|
|
|
141
122
|
projectDirPath = "";
|
|
142
123
|
projectRoot = "";
|
|
143
124
|
targets = (
|
|
144
|
-
58B511DA1A9E6C8500147676 /*
|
|
125
|
+
58B511DA1A9E6C8500147676 /* ReactNativeTracker */,
|
|
145
126
|
);
|
|
146
127
|
};
|
|
147
128
|
/* End PBXProject section */
|
|
148
129
|
|
|
149
|
-
/* Begin PBXShellScriptBuildPhase section */
|
|
150
|
-
4CCD70066BBE9C051429F7AF /* [CP] Check Pods Manifest.lock */ = {
|
|
151
|
-
isa = PBXShellScriptBuildPhase;
|
|
152
|
-
buildActionMask = 2147483647;
|
|
153
|
-
files = (
|
|
154
|
-
);
|
|
155
|
-
inputFileListPaths = (
|
|
156
|
-
);
|
|
157
|
-
inputPaths = (
|
|
158
|
-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
159
|
-
"${PODS_ROOT}/Manifest.lock",
|
|
160
|
-
);
|
|
161
|
-
name = "[CP] Check Pods Manifest.lock";
|
|
162
|
-
outputFileListPaths = (
|
|
163
|
-
);
|
|
164
|
-
outputPaths = (
|
|
165
|
-
"$(DERIVED_FILE_DIR)/Pods-RNSnowplowTracker-checkManifestLockResult.txt",
|
|
166
|
-
);
|
|
167
|
-
runOnlyForDeploymentPostprocessing = 0;
|
|
168
|
-
shellPath = /bin/sh;
|
|
169
|
-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
170
|
-
showEnvVarsInLog = 0;
|
|
171
|
-
};
|
|
172
|
-
/* End PBXShellScriptBuildPhase section */
|
|
173
|
-
|
|
174
130
|
/* Begin PBXSourcesBuildPhase section */
|
|
175
131
|
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
176
132
|
isa = PBXSourcesBuildPhase;
|
|
177
133
|
buildActionMask = 2147483647;
|
|
178
134
|
files = (
|
|
179
|
-
|
|
135
|
+
F4FF95D7245B92E800C19C63 /* ReactNativeTracker.swift in Sources */,
|
|
136
|
+
6BE7197B2AA0B70E003E0F20 /* TrackerVersion.swift in Sources */,
|
|
137
|
+
6BE7197D2AA0B732003E0F20 /* Utilities.swift in Sources */,
|
|
138
|
+
6BE719792AA0B6F7003E0F20 /* ConfigUtils.swift in Sources */,
|
|
180
139
|
);
|
|
181
140
|
runOnlyForDeploymentPostprocessing = 0;
|
|
182
141
|
};
|
|
@@ -191,20 +150,27 @@
|
|
|
191
150
|
CLANG_CXX_LIBRARY = "libc++";
|
|
192
151
|
CLANG_ENABLE_MODULES = YES;
|
|
193
152
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
153
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
194
154
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
155
|
+
CLANG_WARN_COMMA = YES;
|
|
195
156
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
196
157
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
197
158
|
CLANG_WARN_EMPTY_BODY = YES;
|
|
198
159
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
199
160
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
200
161
|
CLANG_WARN_INT_CONVERSION = YES;
|
|
162
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
163
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
201
164
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
165
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
166
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
202
167
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
203
168
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
204
169
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
205
170
|
COPY_PHASE_STRIP = NO;
|
|
206
171
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
207
172
|
ENABLE_TESTABILITY = YES;
|
|
173
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
208
174
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
209
175
|
GCC_DYNAMIC_NO_PIC = NO;
|
|
210
176
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
@@ -235,20 +201,27 @@
|
|
|
235
201
|
CLANG_CXX_LIBRARY = "libc++";
|
|
236
202
|
CLANG_ENABLE_MODULES = YES;
|
|
237
203
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
204
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
238
205
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
206
|
+
CLANG_WARN_COMMA = YES;
|
|
239
207
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
240
208
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
241
209
|
CLANG_WARN_EMPTY_BODY = YES;
|
|
242
210
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
243
211
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
244
212
|
CLANG_WARN_INT_CONVERSION = YES;
|
|
213
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
214
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
245
215
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
216
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
217
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
246
218
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
247
219
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
248
220
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
249
221
|
COPY_PHASE_STRIP = YES;
|
|
250
222
|
ENABLE_NS_ASSERTIONS = NO;
|
|
251
223
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
224
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
252
225
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
253
226
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
254
227
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
@@ -266,7 +239,6 @@
|
|
|
266
239
|
};
|
|
267
240
|
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
268
241
|
isa = XCBuildConfiguration;
|
|
269
|
-
baseConfigurationReference = 7D2A97B8BEC452B270B0AA54 /* Pods-RNSnowplowTracker.debug.xcconfig */;
|
|
270
242
|
buildSettings = {
|
|
271
243
|
HEADER_SEARCH_PATHS = (
|
|
272
244
|
"$(inherited)",
|
|
@@ -276,14 +248,16 @@
|
|
|
276
248
|
);
|
|
277
249
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
278
250
|
OTHER_LDFLAGS = "-ObjC";
|
|
279
|
-
PRODUCT_NAME =
|
|
251
|
+
PRODUCT_NAME = ReactNativeTracker;
|
|
280
252
|
SKIP_INSTALL = YES;
|
|
253
|
+
SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeTracker-Bridging-Header.h";
|
|
254
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
255
|
+
SWIFT_VERSION = 5.0;
|
|
281
256
|
};
|
|
282
257
|
name = Debug;
|
|
283
258
|
};
|
|
284
259
|
58B511F11A9E6C8500147676 /* Release */ = {
|
|
285
260
|
isa = XCBuildConfiguration;
|
|
286
|
-
baseConfigurationReference = 4D25182CF98251495D063E8A /* Pods-RNSnowplowTracker.release.xcconfig */;
|
|
287
261
|
buildSettings = {
|
|
288
262
|
HEADER_SEARCH_PATHS = (
|
|
289
263
|
"$(inherited)",
|
|
@@ -293,15 +267,17 @@
|
|
|
293
267
|
);
|
|
294
268
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
295
269
|
OTHER_LDFLAGS = "-ObjC";
|
|
296
|
-
PRODUCT_NAME =
|
|
270
|
+
PRODUCT_NAME = ReactNativeTracker;
|
|
297
271
|
SKIP_INSTALL = YES;
|
|
272
|
+
SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeTracker-Bridging-Header.h";
|
|
273
|
+
SWIFT_VERSION = 5.0;
|
|
298
274
|
};
|
|
299
275
|
name = Release;
|
|
300
276
|
};
|
|
301
277
|
/* End XCBuildConfiguration section */
|
|
302
278
|
|
|
303
279
|
/* Begin XCConfigurationList section */
|
|
304
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "
|
|
280
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ReactNativeTracker" */ = {
|
|
305
281
|
isa = XCConfigurationList;
|
|
306
282
|
buildConfigurations = (
|
|
307
283
|
58B511ED1A9E6C8500147676 /* Debug */,
|
|
@@ -310,7 +286,7 @@
|
|
|
310
286
|
defaultConfigurationIsVisible = 0;
|
|
311
287
|
defaultConfigurationName = Release;
|
|
312
288
|
};
|
|
313
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "
|
|
289
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ReactNativeTracker" */ = {
|
|
314
290
|
isa = XCConfigurationList;
|
|
315
291
|
buildConfigurations = (
|
|
316
292
|
58B511F01A9E6C8500147676 /* Debug */,
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import SnowplowTracker
|
|
3
|
+
|
|
4
|
+
class ConfigUtils {
|
|
5
|
+
|
|
6
|
+
static func mkTrackerConfig(_ trackerConfig: NSDictionary) -> TrackerConfiguration {
|
|
7
|
+
let trackerConfiguration = TrackerConfiguration()
|
|
8
|
+
trackerConfiguration.trackerVersionSuffix = kRNTrackerVersion
|
|
9
|
+
|
|
10
|
+
if let appId = trackerConfig.object(forKey: "appId") as? String {
|
|
11
|
+
trackerConfiguration.appId = appId;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if let devicePlatform = trackerConfig.object(forKey: "devicePlatform") as? String,
|
|
15
|
+
let index = ["web", "mob", "pc", "srv", "app", "tv", "cnsl", "iot"].firstIndex(of: devicePlatform),
|
|
16
|
+
let platform = DevicePlatform(rawValue: index) {
|
|
17
|
+
trackerConfiguration.devicePlatform = platform
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if let base64 = trackerConfig.object(forKey: "base64Encoding") as? NSNumber {
|
|
21
|
+
trackerConfiguration.base64Encoding = base64.boolValue
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if let logLevel = trackerConfig.object(forKey: "logLevel") as? String,
|
|
25
|
+
let index = ["off", "error", "debug", "verbose"].firstIndex(of: logLevel),
|
|
26
|
+
let level = LogLevel(rawValue: index) {
|
|
27
|
+
trackerConfiguration.logLevel = level
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if let sessionContext = trackerConfig.object(forKey: "sessionContext") as? NSNumber {
|
|
31
|
+
trackerConfiguration.sessionContext = sessionContext.boolValue
|
|
32
|
+
}
|
|
33
|
+
if let applicationContext = trackerConfig.object(forKey: "applicationContext") as? NSNumber {
|
|
34
|
+
trackerConfiguration.applicationContext = applicationContext.boolValue
|
|
35
|
+
}
|
|
36
|
+
if let platformContext = trackerConfig.object(forKey: "platformContext") as? NSNumber {
|
|
37
|
+
trackerConfiguration.platformContext = platformContext.boolValue
|
|
38
|
+
}
|
|
39
|
+
if let geoLocationContext = trackerConfig.object(forKey: "geoLocationContext") as? NSNumber {
|
|
40
|
+
trackerConfiguration.geoLocationContext = geoLocationContext.boolValue
|
|
41
|
+
}
|
|
42
|
+
if let screenContext = trackerConfig.object(forKey: "screenContext") as? NSNumber {
|
|
43
|
+
trackerConfiguration.screenContext = screenContext.boolValue
|
|
44
|
+
}
|
|
45
|
+
if let deepLinkContext = trackerConfig.object(forKey: "deepLinkContext") as? NSNumber {
|
|
46
|
+
trackerConfiguration.deepLinkContext = deepLinkContext.boolValue
|
|
47
|
+
}
|
|
48
|
+
if let screenViewAutotracking = trackerConfig.object(forKey: "screenViewAutotracking") as? NSNumber {
|
|
49
|
+
trackerConfiguration.screenViewAutotracking = screenViewAutotracking.boolValue
|
|
50
|
+
} else {
|
|
51
|
+
trackerConfiguration.screenViewAutotracking = false
|
|
52
|
+
}
|
|
53
|
+
if let lifecycleAutotracking = trackerConfig.object(forKey: "lifecycleAutotracking") as? NSNumber {
|
|
54
|
+
trackerConfiguration.lifecycleAutotracking = lifecycleAutotracking.boolValue
|
|
55
|
+
}
|
|
56
|
+
if let installAutotracking = trackerConfig.object(forKey: "installAutotracking") as? NSNumber {
|
|
57
|
+
trackerConfiguration.installAutotracking = installAutotracking.boolValue
|
|
58
|
+
}
|
|
59
|
+
if let exceptionAutotracking = trackerConfig.object(forKey: "exceptionAutotracking") as? NSNumber {
|
|
60
|
+
trackerConfiguration.exceptionAutotracking = exceptionAutotracking.boolValue
|
|
61
|
+
}
|
|
62
|
+
if let diagnosticAutotracking = trackerConfig.object(forKey: "diagnosticAutotracking") as? NSNumber {
|
|
63
|
+
trackerConfiguration.diagnosticAutotracking = diagnosticAutotracking.boolValue
|
|
64
|
+
}
|
|
65
|
+
if let userAnonymisation = trackerConfig.object(forKey: "userAnonymisation") as? NSNumber {
|
|
66
|
+
trackerConfiguration.userAnonymisation = userAnonymisation.boolValue
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return trackerConfiguration
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static func mkSessionConfig(_ sessionConfig: NSDictionary) -> SessionConfiguration? {
|
|
73
|
+
if let foreground = sessionConfig.object(forKey: "foregroundTimeout") as? NSNumber,
|
|
74
|
+
let background = sessionConfig.object(forKey: "backgroundTimeout") as? NSNumber {
|
|
75
|
+
return SessionConfiguration(foregroundTimeoutInSeconds: foreground.intValue, backgroundTimeoutInSeconds: background.intValue)
|
|
76
|
+
}
|
|
77
|
+
return nil
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static func mkEmitterConfig(_ emitterConfig: NSDictionary) -> EmitterConfiguration? {
|
|
81
|
+
let emitterConfiguration = EmitterConfiguration()
|
|
82
|
+
if let bufferOption = emitterConfig.object(forKey: "bufferOption") as? String {
|
|
83
|
+
if bufferOption == "default" {
|
|
84
|
+
emitterConfiguration.bufferOption = .defaultGroup;
|
|
85
|
+
} else if bufferOption == "large" {
|
|
86
|
+
emitterConfiguration.bufferOption = .largeGroup;
|
|
87
|
+
} else {
|
|
88
|
+
emitterConfiguration.bufferOption = .single;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if let emitRange = emitterConfig.object(forKey: "emitRange") as? NSNumber {
|
|
93
|
+
emitterConfiguration.emitRange = emitRange.intValue
|
|
94
|
+
}
|
|
95
|
+
if let threadPoolSize = emitterConfig.object(forKey: "threadPoolSize") as? NSNumber {
|
|
96
|
+
emitterConfiguration.threadPoolSize = threadPoolSize.intValue
|
|
97
|
+
}
|
|
98
|
+
if let byteLimitGet = emitterConfig.object(forKey: "byteLimitGet") as? NSNumber {
|
|
99
|
+
emitterConfiguration.byteLimitGet = byteLimitGet.intValue
|
|
100
|
+
}
|
|
101
|
+
if let byteLimitPost = emitterConfig.object(forKey: "byteLimitPost") as? NSNumber {
|
|
102
|
+
emitterConfiguration.byteLimitPost = byteLimitPost.intValue
|
|
103
|
+
}
|
|
104
|
+
if let serverAnonymisation = emitterConfig.object(forKey: "serverAnonymisation") as? NSNumber {
|
|
105
|
+
emitterConfiguration.serverAnonymisation = serverAnonymisation.boolValue
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return emitterConfiguration
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static func mkSubjectConfig(_ subjectConfig: NSDictionary) -> SubjectConfiguration? {
|
|
112
|
+
|
|
113
|
+
let subjectConfiguration = SubjectConfiguration()
|
|
114
|
+
|
|
115
|
+
if let userId = subjectConfig.object(forKey: "userId") as? String {
|
|
116
|
+
subjectConfiguration.userId = userId
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if let networkUserId = subjectConfig.object(forKey: "networkUserId") as? String {
|
|
120
|
+
subjectConfiguration.networkUserId = networkUserId
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if let domainUserId = subjectConfig.object(forKey: "domainUserId") as? String {
|
|
124
|
+
subjectConfiguration.domainUserId = domainUserId
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if let useragent = subjectConfig.object(forKey: "useragent") as? String {
|
|
128
|
+
subjectConfiguration.useragent = useragent
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if let ipAddress = subjectConfig.object(forKey: "ipAddress") as? String {
|
|
132
|
+
subjectConfiguration.ipAddress = ipAddress
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if let timezone = subjectConfig.object(forKey: "timezone") as? String {
|
|
136
|
+
subjectConfiguration.timezone = timezone
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if let language = subjectConfig.object(forKey: "language") as? String {
|
|
140
|
+
subjectConfiguration.language = language
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// screenResolution - type checked RN side
|
|
144
|
+
if let screenRSize = subjectConfig.object(forKey: "screenResolution") as? NSArray,
|
|
145
|
+
let resWidth = screenRSize.object(at: 0) as? NSNumber,
|
|
146
|
+
let resHeight = screenRSize.object(at: 1) as? NSNumber {
|
|
147
|
+
let resSize = SPSize(width: resWidth.intValue, height: resHeight.intValue)
|
|
148
|
+
subjectConfiguration.screenResolution = resSize
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// screenViewport - type checked RN side
|
|
152
|
+
if let screenVPSize = subjectConfig.object(forKey: "screenViewport") as? NSArray,
|
|
153
|
+
let vpWidth = screenVPSize.object(at: 0) as? NSNumber,
|
|
154
|
+
let vpHeight = screenVPSize.object(at: 1) as? NSNumber {
|
|
155
|
+
let vpSize = SPSize(width: vpWidth.intValue, height: vpHeight.intValue)
|
|
156
|
+
subjectConfiguration.screenViewPort = vpSize
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// colorDepth
|
|
160
|
+
if let colorDepth = subjectConfig.object(forKey: "colorDepth") as? NSNumber {
|
|
161
|
+
subjectConfiguration.colorDepth = colorDepth
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return subjectConfiguration;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static func mkGdprConfig(_ gdprConfig: NSDictionary) -> GDPRConfiguration? {
|
|
168
|
+
if let basis = gdprConfig.object(forKey: "basisForProcessing") as? String,
|
|
169
|
+
let docId = gdprConfig.object(forKey: "documentId") as? String,
|
|
170
|
+
let docVer = gdprConfig.object(forKey: "documentVersion") as? String,
|
|
171
|
+
let docDesc = gdprConfig.object(forKey: "documentDescription") as? String {
|
|
172
|
+
|
|
173
|
+
return GDPRConfiguration(basis: Utilities.getBasis(basis), documentId: docId, documentVersion: docVer, documentDescription: docDesc)
|
|
174
|
+
}
|
|
175
|
+
return nil
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static func mkGCConfig(_ gcConfig: NSArray) -> GlobalContextsConfiguration? {
|
|
179
|
+
|
|
180
|
+
let gcConfiguration = GlobalContextsConfiguration()
|
|
181
|
+
|
|
182
|
+
for gcMap in gcConfig {
|
|
183
|
+
if let gcMap = gcMap as? NSDictionary,
|
|
184
|
+
let itag = gcMap.object(forKey: "tag") as? String,
|
|
185
|
+
let globalContexts = gcMap.object(forKey: "globalContexts") as? NSArray {
|
|
186
|
+
let staticContexts: [SelfDescribingJson] = globalContexts.map { sdj in
|
|
187
|
+
if let sdj = sdj as? NSDictionary,
|
|
188
|
+
let schema = sdj.object(forKey: "schema") as? String,
|
|
189
|
+
let data = sdj.object(forKey: "data") as? Dictionary<String, Any> {
|
|
190
|
+
return SelfDescribingJson(schema: schema, andDictionary: data)
|
|
191
|
+
} else {
|
|
192
|
+
return nil
|
|
193
|
+
}
|
|
194
|
+
}.compactMap { $0 }
|
|
195
|
+
|
|
196
|
+
if !staticContexts.isEmpty {
|
|
197
|
+
let gcStatic = GlobalContext(staticContexts: staticContexts)
|
|
198
|
+
_ = gcConfiguration.add(tag: itag, contextGenerator: gcStatic)
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return gcConfiguration;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import SnowplowTracker
|
|
3
|
+
|
|
4
|
+
class Utilities {
|
|
5
|
+
|
|
6
|
+
static func getBasis(_ basis: String) -> GDPRProcessingBasis {
|
|
7
|
+
switch basis {
|
|
8
|
+
case "consent":
|
|
9
|
+
return .consent
|
|
10
|
+
case "contract":
|
|
11
|
+
return .contract
|
|
12
|
+
case "legal_obligation":
|
|
13
|
+
return .legalObligation
|
|
14
|
+
case "legitimate_interests":
|
|
15
|
+
return .legitimateInterests
|
|
16
|
+
case "public_task":
|
|
17
|
+
return .publicTask
|
|
18
|
+
default:
|
|
19
|
+
return .vitalInterest
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static func mkSDJArray(_ sdjArray: NSArray) -> [SelfDescribingJson] {
|
|
24
|
+
return sdjArray.map { sdj in
|
|
25
|
+
if let sdj = sdj as? NSDictionary,
|
|
26
|
+
let schema = sdj.object(forKey: "schema") as? String,
|
|
27
|
+
let dict = sdj.object(forKey: "data") as? Dictionary<String, Any> {
|
|
28
|
+
|
|
29
|
+
let nativeSdj = SelfDescribingJson(schema: schema, andDictionary: dict)
|
|
30
|
+
return nativeSdj
|
|
31
|
+
} else {
|
|
32
|
+
return nil
|
|
33
|
+
}
|
|
34
|
+
}.compactMap { $0 }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
package/lefthook.yml
ADDED